1.
Who is attributed with inventing GIT?
Correct Answer
D. Linus Torvalds
Explanation
Linus Torvalds is attributed with inventing GIT. He is a Finnish-American software engineer who created the distributed version control system in 2005. GIT was developed to manage the Linux kernel development, and it has since become widely used in the software development industry. Torvalds' invention of GIT revolutionized the way developers collaborate and track changes in their code, making it easier to manage large-scale projects with multiple contributors.
2.
Which of these terms best describes GitHub?
Correct Answer
D. Web-Based Repository Hosting Service
Explanation
GitHub is a web-based repository hosting service that allows users to store and manage their code repositories. It provides a platform for developers to collaborate on projects, track changes, and manage versions of their code using a distributed version control system. While it also offers features like issue tracking and integration with various development tools, the primary function of GitHub is to host and provide access to code repositories over the internet.
3.
What is the opposite of a GIT clone?
Correct Answer
A. GIT push
Explanation
The opposite of a GIT clone is a GIT push. A GIT clone is used to create a local copy of a repository from a remote source, while a GIT push is used to upload the local changes to the remote repository. So, while a clone brings the repository to the local machine, a push sends the local changes back to the remote repository.
4.
What command do you run to view the commit history of your repository?
Correct Answer
B. GIT log
Explanation
To view the commit history of a repository, you would run the command "GIT log". This command will display a list of all the commits made in the repository, including the commit message, author, date, and unique commit hash. It provides a chronological view of all the changes and updates made to the repository over time.
5.
How do you check the state of your local git repository since your last commit?
Correct Answer
B. GIT status
Explanation
To check the state of your local git repository since your last commit, you can use the "GIT status" command. This command provides information about any changes made to the repository, such as modified files or untracked files. It allows you to see the current status of your repository and helps you keep track of your changes before committing them.
6.
What's a shortcut to staging all the changes you have?
Correct Answer
C. GIT add
Explanation
The correct answer is "GIT add". This command is used to stage all the changes you have made in your local repository. It allows you to prepare the changes for the next commit. By using "GIT add", you are indicating to Git which files or changes you want to include in the next commit. This is an essential step in the Git workflow as it helps in organizing and tracking changes effectively.
7.
How do you supply a commit message to a commit?
Correct Answer
D. GIT commit -m "I'm coding!"
Explanation
To supply a commit message to a commit in GIT, the correct way is to use the command "GIT commit -m "I'm coding!". This command allows the user to add a specific message to the commit, in this case, "I'm coding!". The "-m" flag is used to specify that the following text should be treated as the commit message. This helps in providing a clear and concise description of the changes made in the commit.
8.
What's the git command that downloads your repository from GitHub to your computer?
Correct Answer
C. GIT clone
Explanation
The correct answer is GIT clone. This command is used to download a copy of a repository from GitHub to your local computer. It creates a new directory on your computer with the same name as the repository and copies all the files and commit history from the remote repository to your local machine. This allows you to work on the project locally and make changes before pushing them back to the remote repository.
9.
Which is the correct usage of the push command?
Correct Answer
A. GIT push <remote> <branch>
Explanation
The correct usage of the push command is "GIT push ". This command is used to push the local branch to the specified remote repository. By specifying the remote and branch in this order, the changes made in the local branch will be pushed to the corresponding branch in the remote repository.
10.
What is the correct order to submit your changes from the working directory all the way to the remote repository?
Correct Answer
A. GIT add, git commit, git push
Explanation
The correct order to submit changes from the working directory all the way to the remote repository is to first use "git add" to stage the changes, then use "git commit" to commit the changes to the local repository, and finally use "git push" to push the committed changes to the remote repository. This order ensures that the changes are properly staged, committed, and then pushed to the remote repository for others to access and view.
11.
Which of these terms best describes git?
Correct Answer
B. Distributed Version Control System
Explanation
Git is a distributed version control system, which means it allows multiple users to collaborate on a project by tracking and managing changes to the source code. Unlike centralized version control systems, Git does not rely on a central server, allowing each user to have their own copy of the entire project history. This enables users to work offline and merge their changes with others seamlessly. Git also provides features like branching and merging, making it a powerful tool for software development teams.
12.
Which of the following commands show changes between commits?
Correct Answer
C. GIT diff
Explanation
The correct answer is "GIT diff". The "GIT diff" command is used to show the changes between commits. It compares the differences in the content of files between two commit snapshots and displays the added, modified, or deleted lines. This command is commonly used to review changes before committing them or to compare different versions of a file.
13.
Which of the following commands join two or more development histories together?
Correct Answer
A. GIT merge
Explanation
The correct answer is GIT merge. The merge command in Git is used to combine two or more development histories together. It allows changes from one branch to be integrated into another branch, effectively joining the development histories of those branches. This is commonly used when working with feature branches or when incorporating changes from multiple contributors into a main branch.
14.
Which of the following commands is used in switching between branches?
Correct Answer
D. Both A and B
Explanation
The command "GIT checkout" or "GIT switch" is used in switching between branches in Git. When we use this command followed by the name of the branch we want to switch to, Git updates the files in our working directory to match the version of the files in that branch. This allows us to easily move between different branches and work on different features or bug fixes.
15.
Which of the following commands is used to reset the current HEAD to the specified state?
Correct Answer
A. GIT reset
Explanation
GIT reset command is used to reset the current HEAD to the specified state. This command allows the user to move the HEAD and the branch pointer to a different commit, effectively undoing the changes made after that commit. It can be used to unstage files or to completely remove commits from the branch history.