Available for hire
Git Tips

I’ll just post a few quick little command line git commands. Basic Commands Sync the meta data (e.g. branch names, tag names, etc) with remote.. This will not update the branches, just the names, etc.

git fetch

To see a list of remote branches

git branch -r

To see a list of local branches

git branch


git branch -l

To see both local and remote

git branch -a

Branching To create a new branch from the branch you are currently on.

git checkout -b new_branch

To delete a branch

git branch -d new_branch

To delete a remote branch

git push origin :new_branch

To checkout into a new branch, and merge uncommitted changes

git checkout -mb new_branch

To checkout into an existing branch, merging uncommitted changes

git checkout -m existing_branch

Checkout a remote branch (one that you haven’t checked out before)

git checkout --track -b branch_name origin/branch_name

Tags To tag at the current point in time on the current branch

git tag new_tag

To push tag to a remote

git push --tags

To delete a tag (locally)

git tag -d new_tag

To delete a tag from a remote

git push origin :tags/new_tag