Skip to content

Tips and trick for Git

jooyce edited this page Dec 6, 2011 · 12 revisions

How to create a branch on the remote

git push origin origin:refs/heads/nameofyournewbranch
By default the newest branch is based on origin/master branch

How to delete a branch on the remote

git branch -r -d origin/nameofthebranchtodelete
When you delete a branch on the remote, it don't delete this branch to the people who have this branch in local

How to track a remote branch

git checkout --track -b nameofyourlocalbranch origin/nameoftheremotebranch

How to push your modification on the remote

git push origin nameoftheremotebranch

How to switch to an another local branch

git checkout nameoftheanotherlocalbranch

Clone this wiki locally