{ Branching and Merging Exercises. }

Part I

Answer the following questions:

  • What does git clean do?
  • What do the -d and -f flags for git clean do?
  • What git command creates a branch?
  • What is the difference between a fast-forward and recursive merge?
  • What git command changes to another branch?
  • How do you remove modified or deleted files from the working directory?
  • What git command deletes a branch?
  • What does the git diff command do?
  • How do you remove files from the staging area?
  • How do merge conflicts happen?

Part II

Create your own merge conflict! Work on the same file on two separate branches and merge the two branches together. Fix the conflicts and finish your merge. In the real world you will never intentionally try to create merge conflicts, but it is important to understand how and why they are created. Most importantly, it's important not to be intimidated by merge conflicts, and to be able to fix them with confidence!

You can find the solutions here

When you're ready, move on to Stashing

Continue

Creative Commons License