Gangmax Blog

Git: Create a Local Branch from Remote Branch

Some useful git command about branch are listed below, from here and here.

1
2
3
4
5
6
7
8
9
10
11
# Create a new local branch based on an existing remote branch.
git checkout -b new-branch-name --track origin/master

# Cherry pick existing commit to the crrent branch.
git cherry-pick 0bf06d7dd0b2644b7f0f8f4a5f6f24447da34842

# Remove a remote branch.
git push origin -d name_of_a_branch

# Remove a local branch.
git branch -d name_of_a_branch

Comments