- Run
source setup.sh
(or.\setup.ps1
in PowerShell)
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.
- Create a (feature)branch called feature/uppercase
- Checkout the branch
- What is the output of
git status
? - Edit the greeting.txt to contain an uppercase greeting
- Add greeting.txt files to staging area and commit
- What is the output of
git branch
? - 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).
- Checkout
master
branch - Use
cat
to see the contents of the greetings - Diff the branches
- Merge the branches
- Use
cat
to see the contents of the greetings - Delete the uppercase branch
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