Change master to Rails 3 branch in GIT?
I currently have the following structure in my GIT repository:
// LOCAL
/master
/rails3 (HEAD)
// REMOTE
/HEAD
/master
/rails3
I am not sure why the remote (GitHub in this case) has a HEAD branch and the local version doesn't.
I am trying to workout what how to switch the Rails3 branch to be master and rename the master branch to be called Rails2. I am using Tower for Mac which has a rename option for the local branches but I am concerned what will happen if I then push that branch to the master.
Any help/advice is greatly appreciated!
Thanks,
Danny
UP开发者_开发问答DATE
git branch -a
MacBook:BaseApp2 danny$ git branch -a
master
* rails3
remotes/beanstalk/master
remotes/beanstalk/rails3
remotes/heroku/master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/rails3
What does git branch -a
displays for you?
I have for instance:
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
meaning HEAD isn't a branch, but a pointer (commit) to the remote master branch.
To change the branch referenced by HEAD (and rename master on the GitHub side), see:
"How do I change a Git remote HEAD to point to something besides “master”"
精彩评论