tracking a different branch on github
I am trying to track a different branch of a github project.
The project is restful_authentication:
However, what I really want to clone is the modular branch:
I found this guide:
and tried a few commands like:
git checkout --track -b lmod http://github.com/technoweenie/restful-authentication/tree/modular
git checkout --track -b lmod git://github.com/technoweenie/restful-authentication.git/modular
but I am getting the following error:
fatal: git checkout: updating paths is incompatible with switching branches
Any thoughts on the correct way to do this?
One Solution collect form web for “tracking a different branch on github”
You cannot just clone a branch, you have to clone the full repository:
git clone git://github.com/technoweenie/restful-authentication.git
Then you can use a tracking branch in your local repository:
cd restful-authentication git checkout --track -b lmod origin/modular
Note that, after cloning, git has set up a “remote” with the name “origin” for the remote repository and “origin/modular” identifies the “modular” branch of the “origin” remote.