Tuesday, March 23, 2010

git: import remote branches (and mirror them locally)


$ git fetch
$ git branch -r

origin/HEAD -> origin/master
origin/master
origin/stable
origin/alternate_branch

$ git checkout -b alternate_branch origin/alternate_branch


In case of mistake:


$ git reset --hard <commit>
$ git push -f origin branch_name # use with caution since you loose history! # git-revert?