Git Branching

Git branch is actually a commit node tree.
git_branch.png

Let’s make a vivid visualization

After finishing the commit, that newly created commit will be placed on the HEAD.
git_branch_1.png

You could create a new branch based on a existing branch.

git checkout -b Development

git_branch_2.png

Now you can commit on the Development branch
git_branch_3.png

We can go back to the master branch and continue commiting on master branch

git checkout master

git_branch_5.png

We can create another branch

git checkout -b other

git_branch_6.png

And still checkout the master branch again

git checkout master

git_branch_7.png

As you can see HEAD pointer is a special branch name that always point to the current branch or commit that we are working on.


Git Branching
https://rug.al/2016/2016-10-02-git-branching/
Author
Rugal Bernstein
Posted on
October 2, 2016
Licensed under