Questions
Answer the following questions to test your knowledge of this chapter:
- How does creating a new commit change the history stored in the repository — that is, how does it change the graph of revisions and where branch heads point to?
- What is the difference between
git commit
andgit commit --all
(orgit
commit -a
)? - How do you check what changes you have made in the local repository? How do you undo them?
- What is the simplest way to fix an error in the commit message of the last commit on the current branch?
- What do you do when you realize that the changes you started to write (but didn’t commit) should be made on a separate new branch?
- What is the simplest way to switch to the previous branch, and when can it fail?