Friday, June 12, 2020

Useful GIT branch commands

GIT commands are more powerful and flexible to use rather using GUI tools, Learning git commands will gives the insight of GIT and features. I am listing the most useful git commands with respect to branches.  


List Local and  Remote Branches
git branch -a

List  Remote Branches
git branch -r

List Branches with Recent commits
git branch show-branch

Switch to other branch
git switch <branch-name>

Display status of the checked out branch 
git status

Create tags
git tag -a "<tag name>" -m "<tag message>"

Display all the tags
git tag ls

Create branch from tag
git branch <branch name> <tag name>

Display Logs
git log

Delete Branch
git branch -d <branch name> - Local branch
git branch -d origin <branch name> - Delete remote branch (origin is the default remote branch)



Git - Basic Branching and Merging



No comments: