views:

57

answers:

2

I currently have a rails project running of a git tag v2.1.2, to get here id did

git checkout v2.1.2

However there are now new fix's that have been applied to the 2.1 branch, how do I move to this branch rather than the tag?

+1  A: 

If I understand your question correctly, you have a tag and a branch named the same. Then, to checkout to the branch, you would provide the path to it.

For example:

git checkout refs/heads/2.1

This disambiguates 2.1 branch from a tag named 2.1 itself.

Alan Haggai Alavi
Hi, sorry didn’t explain it properly, the branch I want to checkout is located at http://github.com/rails/rails/tree/2-1-stable
+1  A: 

You can create a new branch that tracks the remote 2-1-stable like so:

git checkout -b 2-1-stable origin/2-1-stable

Then just cd back to rails root and commit the submodule change.

Later if you need to update it, you should just be able to cd back into vendor/rails and:

git remote update
git rebase origin/2-1-stable

And commit the changes again.

Mark Connell