Git checkout branch

Code examples

10
0

git checkout new branch

// create and checkout new branch in one line
git checkout -b new_branch
8
0

git checkout remote branch

# In modern versions of Git, you can checkout the remote branch like a local branch.
git checkout <remotebranch>

# Older versions of Git require the creation of a new branch based on the remote.
git checkout <remotebranch> origin/<remotebranch>
6
0

git checkout branch

truelover@PEACE project % git checkout master
truelover@PEACE project % git checkout branch_name
#create branch
truelover@PEACE project % git checkout -b new_branch_name
6
0

git checkout

git checkout -b origin/branch-name
git checkout -b branch-name
4
0

how to create new branch

How to create a new branch in git 

$ git checkout -b good

here good is new branch name
the line 3 after executing we will go to that branch
3
0

git branch and checkout at the same time

$ git checkout -b <branch_name>

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................