Tag Archives: git_branch

Git basics: create and delete branches remotely

To create a remote branch:

$ git checkout -b <branch-name>
$ git push -u origin <branch-name>

To delete a remote branch:

$ git push origin --delete <branch-name> 
$ git branch -d <branch-name>

If there are unmerged changes which you are confident of deleting:

$ git branch -D <branch-name>

And that is all.

Cheers!

Advertisements