Wednesday, February 9, 2011

How to create, work and delete a remote branch in git

- Create a new remote branch "abc"
git push origin origin:refs/heads/abc

- Checkout remote branch in your local directory to work on it
git checkout --track -b abc origin/abc

- To make any changes to branch abc and push to remote branch "abc"
git push

- To get latest changes from the remote branch "abc"
git pull

- Delete local  and remote branch "abc"
git checkout master
git branch -r -d origin/abc
git branch -D abc

- Delete remote branch "abc" from github
git push origin :abc

No comments:

Post a Comment