GitHub

Basics

Check out a remote Git branch

# List all remote branches
$ git branch -r
# List all remote and local branches
git branch -a 
# List all local branches
git branch 

# Checkout a remote branch as a local branch
$ git checkout -b local_branch_name origin/remote_branch_name

Merge the changes from the master to a branch

$ git pull origin master

Check out/switch a local Git branch

# Create a new branch
$ git checkout -b myNewBranchName
# Switch to an existing branch
$ git checkout myBranchName

Remove a local branch

$ git branch -D myLocalBranchName

Remove a remote branch

git push origin --delete myRemoteBranchName

Add a tag

$ git tag -a v2.0.0 -m "release v2.0.0"
$ git push origin v2.0.0

Delete a tag

# delete a local tag
git tag -d v2.0.0
# delete a remote tag
git push origin --delete v2.0.0