Exercise - Branching
Info
git branch
Tips
git switch -c <name>
creates a new branch and activates it immediately.git branch -vv
shows details about the local branchesgit switch <name>
switches the active branchgit merge <branch>
integrates the changes frombranch
and creates a commit on the active branch.
Initial situation
Step 0 - START
$ cd repo
Step 1 - Create branch
Start in directory git-uebungen/aufgaben/<unknown>
.
Create a branch feature-a
, edit the file foo
and create a commit. Then switch back to main
and edit bar
there. Show the commit graph.
Step 2 - Merge branch
Start in directory git-uebungen/aufgaben/<unknown>
.
Merge feature-a
into main
and show the commit graph.
repo $ cd ..