tags:

views:

32

answers:

1

Ok, I am pretty new to git, probably this was asked and answered already. Probably I messed up things...

Now, there once was a branch master. I committed some funky stuff that didn't work too well. Then I went back one revision, when everything was still well, and created an experimental branch and checked it out. I started working on that branch and things went very well, no need for the funk in master's head. So, now I am dozens of commits in the experimental branch and it is not experimental anymore. So I checked out master, and went to the branching revision (one before head) and successfully merged with experimental. Now git branch gives me

* (no branch)
  experimental
  master

How can I make it master and master's head?

A: 

From the detached HEAD, you could delete the master branch and create a new branch named master.

git branch -d master
git branch master
Alan Haggai Alavi
Wouldn't I loose history that way?
Jan Limpens
The "experimental" branch will still contain all of the "master" branch history from before they diverged. If you want to be extra careful (and who doesn't?), just rename the branches with the command `git branch -m <oldname> <newname>`.
ewall