1

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

UPDATE

  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
dannymcc
  • 3,744
  • 12
  • 52
  • 85
  • So as I say in my answer; `HEAD -> origin/master` doesn't mean your remote GitHub repo has a branch named '`HEAD`', it is a **symbolic reference** to the `remote` master branch. So you need to rename `remote/master` as shown in the link I propose below. – VonC Feb 23 '11 at 13:14

1 Answers1

1

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”"

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250