- Run
source setup.sh(or.\setup.ps1in 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(yes,feature/uppercaseis a perfectly legal branch name, and a common convention). -
Switch to this branch
-
What is the output of
git status? -
Edit the greeting.txt to contain an uppercase greeting
-
Add
greeting.txtfiles to staging area and commit -
What is the output of
git branch? -
What is the output of
git log --oneline --graph --allRemember: You want to update the master branch so it also has all the changes currently on the feature branch. The command 'git merge [branch name]' takes one branch as argument from which it takes changes. The branch pointed to by HEAD (currently checked out branch) is then updated to also include these changes.
-
Switch to the
masterbranch -
Use
catto see the contents of the greetings -
Diff the branches
-
Merge the branches
-
Use
catto see the contents of the greetings -
Delete the uppercase branch
git branchgit branch <branch-name>git branch -d <branch-name>git switchgit branch -vgit addgit commitgit commit -mgit merge <branch>git diff <branchA> <branchB>git log --oneline --graph --all