Frequently Used Git Commands

Posted 8 months, 1 week ago
Frequently Used Git Commands

Creating a new branch in git style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-4414117620201366"
data-ad-slot="7237412877">



> git checkout branch-name



Switching to branch in git style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-4414117620201366"
data-ad-slot="3299550751">



> git switch branch-name


  style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-4414117620201366"
data-ad-slot="3445469534">



Create & immediately switch to a newly created branch in git


> git checkout -b branch-name style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-4414117620201366"
data-ad-slot="3445469534">




Checking the current branch name in Git


git branch --show-current style="display:block; text-align:center;"
data-ad-layout="in-article"
data-ad-format="fluid"
data-ad-client="ca-pub-4414117620201366"
data-ad-slot="3445469534">