This section includes 7 InterviewSolutions, each offering curated multiple-choice questions to sharpen your Current Affairs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Name A Few Git Repository Hosting Services: |
| Answer» | |
| 2. |
What Is ‘bare Repository’ In Git? |
|
Answer» To co-ordinate with the distributed development and developers TEAM, especially when you are working on a project from multiple computers ‘Bare Repository’ is USED. A bare repository comprises of a VERSION HISTORY of your code. To co-ordinate with the distributed development and developers team, especially when you are working on a project from multiple computers ‘Bare Repository’ is used. A bare repository comprises of a version history of your code. |
|
| 3. |
Why Is It Advisable To Create An Additional Commit Rather Than Amending An Existing Commit? |
|
Answer» There are couple of reason a) The amend operation will destroy the state that was previously saved in a commit. If it’s just the commit MESSAGE being changed then that’s not an issue. But if the contents are being amended then chances of eliminating something important remains more. B) Abusing “GIT commit- amend” can cause a small commit to grow and ACQUIRE unrelated CHANGES. There are couple of reason a) The amend operation will destroy the state that was previously saved in a commit. If it’s just the commit message being changed then that’s not an issue. But if the contents are being amended then chances of eliminating something important remains more. b) Abusing “git commit- amend” can cause a small commit to grow and acquire unrelated changes. |
|
| 4. |
How Can You Fix A Broken Commit? |
|
Answer» To FIX any broken commit, you will use the COMMAND “git commit—amend”. By running this command, you can fix the broken commit MESSAGE in the EDITOR. To fix any broken commit, you will use the command “git commit—amend”. By running this command, you can fix the broken commit message in the editor. |
|
| 5. |
Explain What Is Commit Message? |
|
Answer» Commit message is a feature of git which APPEARS when you commit a change. Git PROVIDES you a text editor where you can ENTER the MODIFICATIONS made in commits. Commit message is a feature of git which appears when you commit a change. Git provides you a text editor where you can enter the modifications made in commits. |
|
| 6. |
What Does ‘hooks’ Consist Of In Git? |
|
Answer» This directory CONSISTS of Shell scripts which are ACTIVATED after RUNNING the CORRESPONDING Git commands. For example, git will try to execute the post-commit script after you run a commit. This directory consists of Shell scripts which are activated after running the corresponding Git commands. For example, git will try to execute the post-commit script after you run a commit. |
|
| 7. |
How Git Instaweb Is Used? |
|
Answer» ‘Git Instaweb’ automatically DIRECTS a WEB BROWSER and RUNS webserver with an interface into your local repository. ‘Git Instaweb’ automatically directs a web browser and runs webserver with an interface into your local repository. |
|
| 8. |
What Is Git Is-tree? |
|
Answer» ‘git Is-TREE’ represents a tree OBJECT including the MODE and the name of each ITEM and the SHA-1 value of the blob or the tree. ‘git Is-tree’ represents a tree object including the mode and the name of each item and the SHA-1 value of the blob or the tree. |
|
| 9. |
What Is The Function Of ‘git Reset’? |
|
Answer» The function of ‘Git Reset’ is to reset your INDEX as well as the working DIRECTORY to the state of your LAST commit. The function of ‘Git Reset’ is to reset your index as well as the working directory to the state of your last commit. |
|
| 10. |
What Is ‘git Add’ Is Used For? |
|
Answer» ‘GIT add’ adds file changes in your EXISTING directory to your INDEX. ‘git add’ adds file changes in your existing directory to your index. |
|
| 11. |
What Is The Use Of ‘git Log’? |
|
Answer» To find SPECIFIC COMMITS in your project HISTORY- by AUTHOR, date, content or history ‘git log’ is USED. To find specific commits in your project history- by author, date, content or history ‘git log’ is used. |
|
| 12. |
What Is The Function Of ‘git Stash Apply’? |
|
Answer» When you want to continue working where you have left your work, ‘git STASH APPLY’ command is used to bring BACK the SAVED changes ONTO the working directory. When you want to continue working where you have left your work, ‘git stash apply’ command is used to bring back the saved changes onto the working directory. |
|
| 13. |
What Is The Function Of ‘git Rm’? |
|
Answer» To remove the FILE from the STAGING AREA and ALSO off your disk ‘git rm’ is used. To remove the file from the staging area and also off your disk ‘git rm’ is used. |
|
| 14. |
What Is The Function Of ‘git Checkout’ In Git? |
|
Answer» A ‘git checkout’ command is used to update directories or specific files in your working TREE with those from another BRANCH WITHOUT merging it in the WHOLE branch. A ‘git checkout’ command is used to update directories or specific files in your working tree with those from another branch without merging it in the whole branch. |
|
| 15. |
What Is The Difference Between The ‘git Diff ’and ‘git Status’? |
|
Answer» ‘git DIFF’ is similar to ‘git status’, but it SHOWS the differences between various commits and ALSO between the WORKING directory and INDEX. ‘git diff’ is similar to ‘git status’, but it shows the differences between various commits and also between the working directory and index. |
|
| 16. |
What Is ‘git Status’ Is Used For? |
|
Answer» As ‘Git Status’ shows you the DIFFERENCE between the working directory and the INDEX, it is helpful in understanding a git more COMPREHENSIVELY. As ‘Git Status’ shows you the difference between the working directory and the index, it is helpful in understanding a git more comprehensively. |
|
| 17. |
What Is The Function Of ‘git Diff ’ In Git? |
|
Answer» ‘GIT diff ’ SHOWS the changes between COMMITS, commit and working TREE etc. ‘git diff ’ shows the changes between commits, commit and working tree etc. |
|
| 18. |
What Is Subgit? Why To Use Subgit? |
|
Answer» ‘Subgit’ is a tool for a SMOOTH, stress-free SVN to Git migration. Subgit is a SOLUTION for a company -wide migration from SVN to Git that is: a) It is much better than git-svn ‘Subgit’ is a tool for a smooth, stress-free SVN to Git migration. Subgit is a solution for a company -wide migration from SVN to Git that is: a) It is much better than git-svn |
|
| 19. |
Mention Some Of The Best Graphical Git Client For Linux? |
|
Answer» Some of the BEST GIT CLIENT for LINUX is: a) Git Cola Some of the best GIT client for LINUX is: a) Git Cola |
|
| 20. |
What Is Git Version Control? |
|
Answer» With the help of GIT version control, you can TRACK the history of a collection of files and includes the functionality to revert the collection of files to another version. Each version CAPTURES a snapshot of the file system at a CERTAIN point of time. A collection of files and their complete history are STORED in a repository. With the help of GIT version control, you can track the history of a collection of files and includes the functionality to revert the collection of files to another version. Each version captures a snapshot of the file system at a certain point of time. A collection of files and their complete history are stored in a repository. |
|
| 21. |
What Is The Difference Between ‘git Remote’ And ‘git Clone’? |
|
Answer» ‘GIT remote add’ just creates an entry in your git config that SPECIFIES a name for a particular URL. While, ‘git clone’ creates a new git repository by copying and existing one LOCATED at the URI. ‘git remote add’ just creates an entry in your git config that specifies a name for a particular URL. While, ‘git clone’ creates a new git repository by copying and existing one located at the URI. |
|
| 22. |
What Is The Syntax For “rebasing” In Git? |
|
Answer» The SYNTAX USED for REBASE is “GIT rebase [new-commit] “ The syntax used for rebase is “git rebase [new-commit] “ |
|
| 23. |
What Is Another Option For Merging In Git? |
|
Answer» “Rebasing” is an ALTERNATIVE to MERGING in GIT. “Rebasing” is an alternative to merging in git. |
|
| 24. |
To Delete A Branch What Is The Command That Is Used? |
|
Answer» Once your DEVELOPMENT BRANCH is MERGED into the main branch, you don’t NEED development branch. To DELETE a branch use, the command “git branch –d [head]”. Once your development branch is merged into the main branch, you don’t need development branch. To delete a branch use, the command “git branch –d [head]”. |
|
| 25. |
How Can Conflict In Git Resolved? |
|
Answer» To RESOLVE the conflict in git, edit the files to fix the conflicting changes and then add the resolved files by running “git add” after that to commit the REPAIRED MERGE, run “git commit”. Git remembers that you are in the MIDDLE of a merger, so it SETS the parents of the commit correctly. To resolve the conflict in git, edit the files to fix the conflicting changes and then add the resolved files by running “git add” after that to commit the repaired merge, run “git commit”. Git remembers that you are in the middle of a merger, so it sets the parents of the commit correctly. |
|
| 26. |
What Is A ‘conflict’ In Git? |
|
Answer» A ‘conflict’ ARISES when the commit that has to be merged has some change in ONE place, and the current commit ALSO has a change at the same place. Git will not be able to predict which change should TAKE precedence. A ‘conflict’ arises when the commit that has to be merged has some change in one place, and the current commit also has a change at the same place. Git will not be able to predict which change should take precedence. |
|
| 27. |
How Can You Bring A New Feature In The Main Branch? |
|
Answer» To BRING a new feature in the main branch, you can use a COMMAND “GIT merge” or “git PULL command”. To bring a new feature in the main branch, you can use a command “git merge” or “git pull command”. |
|
| 28. |
What Is The Common Branching Pattern In Git? |
|
Answer» The common WAY of CREATING branch in GIT is to maintain one as “Main“ branch and create another branch to implement new features. This pattern is particularly useful when there are multiple DEVELOPERS WORKING on a single project. The common way of creating branch in GIT is to maintain one as “Main“ branch and create another branch to implement new features. This pattern is particularly useful when there are multiple developers working on a single project. |
|
| 29. |
What Is The Purpose Of Branching In Git? |
|
Answer» The purpose of BRANCHING in GIT is that you can create your own branch and jump between those branches. It will ALLOW you to GO to your previous work keeping your RECENT work intact. The purpose of branching in GIT is that you can create your own branch and jump between those branches. It will allow you to go to your previous work keeping your recent work intact. |
|
| 30. |
What Is ‘head’ In Git And How Many Heads Can Be Created In A Repository? |
|
Answer» A ‘HEAD’ is simply a REFERENCE to a commit object. In every REPOSITORY, there is a default head referred as “MASTER”. A repository can contain any number of HEADS. A ‘head’ is simply a reference to a commit object. In every repository, there is a default head referred as “Master”. A repository can contain any number of heads. |
|
| 31. |
How Can You Create A Repository In Git? |
|
Answer» In GIT, to CREATE a repository, create a directory for the PROJECT if it does not exist, and then run command “git init”. By running this command .git directory will be created in the project directory, the directory does not NEED to be empty. In Git, to create a repository, create a directory for the project if it does not exist, and then run command “git init”. By running this command .git directory will be created in the project directory, the directory does not need to be empty. |
|
| 32. |
What Does Commit Object Contain? |
|
Answer» a) A set of FILES, representing the STATE of a project at a GIVEN point of time a) A set of files, representing the state of a project at a given point of time |
|
| 33. |
What Is The Function Of ‘git Config’? |
|
Answer» The ‘GIT config’ command is a convenient way to set configuration options for your Git INSTALLATION. Behaviour of a REPOSITORY, user INFO, preferences etc. can be defined through this command. The ‘git config’ command is a convenient way to set configuration options for your Git installation. Behaviour of a repository, user info, preferences etc. can be defined through this command. |
|
| 34. |
What Is The Function Of Git Clone? |
|
Answer» The git clone command CREATES a copy of an existing Git REPOSITORY. To get the copy of a central repository, ‘cloning’ is the most COMMON WAY used by programmers. The git clone command creates a copy of an existing Git repository. To get the copy of a central repository, ‘cloning’ is the most common way used by programmers. |
|
| 35. |
How Will You Know In Git If A Branch Has Been Already Merged Into Master? |
| Answer» | |
| 36. |
What Is Git Stash Drop? |
|
Answer» When you are DONE with the stashed ITEM or want to REMOVE it from the list, run the git ‘stash drop’ command. It will remove the last added stash item by default, and it can also remove a SPECIFIC item if you INCLUDE as an argument. When you are done with the stashed item or want to remove it from the list, run the git ‘stash drop’ command. It will remove the last added stash item by default, and it can also remove a specific item if you include as an argument. |
|
| 37. |
What Is Git Stash? |
|
Answer» GIT stash takes the current state of the working DIRECTORY and index and puts in on the stack for LATER and gives you back a clean working directory. So in case if you are in the middle of something and need to jump over to the other job, and at the same TIME you don’t want to lose your current edits then you can use GIT stash. GIT stash takes the current state of the working directory and index and puts in on the stack for later and gives you back a clean working directory. So in case if you are in the middle of something and need to jump over to the other job, and at the same time you don’t want to lose your current edits then you can use GIT stash. |
|
| 38. |
What Is “staging Area” Or “index” In Git? |
|
Answer» Before completing the commits, it can be formatted and reviewed in an INTERMEDIATE area KNOWN as ‘STAGING Area’ or ‘Index’. Before completing the commits, it can be formatted and reviewed in an intermediate area known as ‘Staging Area’ or ‘Index’. |
|
| 39. |
Why Git Better Than Subversion? |
|
Answer» GIT is an open source version CONTROL SYSTEM; it will allow you to RUN ‘versions’ of a project, which show the changes that were made to the code overtime also it allows you keep the backtrack if NECESSARY and undo those changes. Multiple developers can checkout, and upload changes and each change can then be attributed to a specific developer. GIT is an open source version control system; it will allow you to run ‘versions’ of a project, which show the changes that were made to the code overtime also it allows you keep the backtrack if necessary and undo those changes. Multiple developers can checkout, and upload changes and each change can then be attributed to a specific developer. |
|
| 40. |
What Is The Function Of ‘git Push’ In Git? |
|
Answer» ‘GIT PUSH’ UPDATES REMOTE refs ALONG with associated OBJECTS. ‘GIT PUSH’ updates remote refs along with associated objects. |
|
| 41. |
What Language Is Used In Git? |
|
Answer» GIT is FAST, and ‘C’ language MAKES this POSSIBLE by reducing the OVERHEAD of runtimes associated with higher languages. GIT is fast, and ‘C’ language makes this possible by reducing the overhead of runtimes associated with higher languages. |
|
| 42. |
What Are The Advantages Of Using Git? |
|
Answer» a) Data REDUNDANCY and replication a) Data redundancy and replication |
|
| 43. |
What Is The Difference Between Git And Svn? |
|
Answer» The DIFFERENCE between GIT and SVN is: a) Git is less preferred for handling extremely large files or frequently changing binary files while SVN can handle multiple projects stored in the same repository. b) GIT does not support ‘commits’ ACROSS multiple branches or tags. Subversion allows the CREATION of FOLDERS at any location in the repository layout. c) Gits are unchangeable, while Subversion allows committers to treat a tag as a branch and to create multiple revisions under a tag root. The difference between GIT and SVN is: a) Git is less preferred for handling extremely large files or frequently changing binary files while SVN can handle multiple projects stored in the same repository. b) GIT does not support ‘commits’ across multiple branches or tags. Subversion allows the creation of folders at any location in the repository layout. c) Gits are unchangeable, while Subversion allows committers to treat a tag as a branch and to create multiple revisions under a tag root. |
|
| 44. |
What Is The Command You Can Use To Write A Commit Message? |
|
Answer» The COMMAND that is used to write a COMMIT message is “git commit –a”. The –a on the command line instructs git to commit the new content of all tracked FILES that have been modified. You can use “git add<FILE>” before git commit –a if new files need to be committed for the first TIME. The command that is used to write a commit message is “git commit –a”. The –a on the command line instructs git to commit the new content of all tracked files that have been modified. You can use “git add<file>” before git commit –a if new files need to be committed for the first time. |
|
| 45. |
What Is A Repository In Git? |
|
Answer» A repository contains a DIRECTORY named .GIT, where git KEEPS all of its metadata for the repository. The CONTENT of the .git directory are private to git. A repository contains a directory named .git, where git keeps all of its metadata for the repository. The content of the .git directory are private to git. |
|
| 46. |
What Is Git? |
|
Answer» GIT is a DISTRIBUTED version control system and source code management (SCM) system with an emphasis to handle small and LARGE projects with speed and efficiency. GIT is a distributed version control system and source code management (SCM) system with an emphasis to handle small and large projects with speed and efficiency. |
|