How To Show All Branches In GIT

Author: , October 29th, 2020

Show All Branches, Local and Remote

Show Local Branches

Show Remote Branches

To fetch all remote branches locally

How To Revert All Changes in a git Branch

Author: , August 2nd, 2018

git checkout -f

How To Rename a Branch in Git Locally and Remotely

Author: , January 31st, 2018

Rename the old branch locally: git branch -m oldBranch newBranch Delete the old branch remotely: git push origin :oldBranch Push up the new branch, and make the local branch track with the new remote branch: git push –set-upstream origin newBranch

How to Manage Remote Branches in Git

Author: , October 19th, 2017

Git does not download all branches unless you tell it to. Until then, they are ‘remote’ branches. Use -r to list remote branches: git branch -r git fetch –all git pull –all If you see this error: fatal: The current branch CT-37 has no upstream branch. Push the current branch and set the remote as […]

How To Compare Two Branches in GIT

Author: , December 10th, 2012

git diff branch1..branch2

How To Delete a Branch from a Remote Repo in GIT

Author: , November 21st, 2012

Do it locally:

Deleted branch yourBranchName (was 340c10d). Do it remotely, and please note the : below! (replace origin with your repo, if different)

To git.yourServer.com:/repos/yourProject.git – [deleted] yourBranchName

How To Find the Currently Checked Out GIT Branch

Author: , November 15th, 2012

git rev-parse –abbrev-ref HEAD