Skip to content

Latest commit

 

History

History
38 lines (31 loc) · 1.26 KB

README.md

File metadata and controls

38 lines (31 loc) · 1.26 KB

Git Kata: Fast-forward Merge

Setup:

  1. Run source setup.sh

The task

You again live in your own branch, this time we will be doing a bit of juggling with branches, to show how lightweight branches are in git.

  1. Create a (feature)branch called feature/uppercase
  2. Checkout the branch
  3. What is the output of git status?
  4. Edit the greeting.txt to contain an uppercase greeting
  5. Add greeting.txt files to staging area and commit
  6. What is the output of git branch?
  7. What is the output of git log --oneline --graph --all

Remember: you want to pull in the commit on the feature branch into master. The command 'git merge [branch name]' takes one branch as argument from which it takes commits. The commits are applied to the branch pointed to by HEAD (currently checked out branch).

  1. Checkout master branch
  2. Use cat to see the contents of the greetings
  3. Diff the branches
  4. Merge the branches
  5. Use cat to see the contents of the greetings
  6. Delete the uppercase branch

Useful commands

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