Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 820 Bytes

README.md

File metadata and controls

29 lines (25 loc) · 820 Bytes

Git exercise: rebase branch

Setup:

continue from the previous

  • git checkout -b uppercase
  • echo "HELLO" > greeting.txt
  • git commit -am "Change greeting to uppercase"
  • git checkout master // or main
  • echo "Greetings library" > README.md
  • git add README.md
  • git commit -m "Add readme"

The task

  1. Which branches exist?
  2. Look at the log for the master branch
  3. Check out the uppercase branch
  4. How does the log compare to the log on the master branch?
  5. Rebase your uppercase branch with the master (git rebase master)
  6. What did just happen? Draw it!
  7. Now checkout the master branch
  8. Merge uppercase into master
  9. What does the log look like now?

Useful commands

  • git checkout <branch-name>
  • git rebase <branch-name>
  • git log --oneline --graph --all
  • git merge <branch-name>