1

I know this might look like a duplicate to the other similar questions, but it is slightly different.

My case:

We've been developing on the master branch for a while and now we want to apply this branching model: A successful Git branching model

So what we want to achieve is to rename the remote master to the develop.

My steps:

git branch -m master develop

git push origin develop

git push origin :master //remove old remote master

At this point I create a new master branch localy from develop and push this remotely: git push origin master

Start using the branching model:

I created a couple of commits on the develop branch. And now I want to make a release 1.

I am going to master. git merge --no-ff develop git push origin master

My problem:

I expect to see the commit history of the old master on the develop branch, but I still see the initial commit on the master branch:

git graph

At the same time when I switch to develop branch and see the log I can see the initial commit on the develop branch.

Question:

Is it possible to achieve what I want and how?

Max
  • 601
  • 8
  • 21

1 Answers1

0

If you create the master branch from develop, it inherits and should inherit the history of develop.

If you created an empty master branch there, it would have no history.

Adder
  • 5,708
  • 1
  • 28
  • 56
  • Adder, yes you are right, it should inherit the history, but on the graph it look like the inital commit not just inherited but made on the master branch. Look at the graph please, as far as I can see the develop branch was created from master, but not the other way around(This is how need it). – Max Jun 26 '14 at 13:18
  • I see, but maybe the point it was created from master from was the empty state? Look how the other commits to develop are merged from develop into master. – Adder Jun 26 '14 at 14:03