Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 1 KB

README.md

File metadata and controls

32 lines (28 loc) · 1 KB

Git exercise: 3-Way Merge

Setup

continue from the Fast-forward Merge exercise

The task

  1. Create a branch called greeting and check it out
  2. Edit the greeting.txt to contain your favorite greeting
  3. Add greeting.txt files to the staging area
  4. Commit
  5. Switch back to the master branch
  6. Create a file README.md with information about this repository
  7. Add the README.md file to staging area and make the commit
  8. What is the output of git log --oneline --graph --all?
  9. Diff the branches
  10. Merge the greeting branch into master
  11. What is the output of git log --oneline --graph --all now? Observe the extra merge commit created with the message "Merge branch 'greeting'".

Useful commands

  • git branch
  • git branch <branch-name>
  • git branch -d <branch-name>
  • git checkout <branch-name>
  • git checkout -b <branch-name>
  • git branch -v
  • git add
  • git commit
  • git commit -m
  • git merge <branchA> <branchB>
  • git diff <branchA> <branchB>
  • git log --oneline --graph --all