- 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 branch called greeting and switch to it
- Edit the greeting.txt to contain your favorite greeting
- Add greeting.txt files to the staging area
- Commit
- Switch back to the master branch
- Create a file README.md with information about this repository
- Add the README.md file to staging area and make the commit
- What is the output of
git log --oneline --graph --all
? - Diff the branches
- Merge the greeting branch into master
- What is the output of
git log --oneline --graph --all
now? Observe the extra merge commit created with the message "Merge branch 'greeting'".
git branch
git branch <branch-name>
git branch -d <branch-name>
git switch <branch-name>
git switch -c <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