0

My program has gone through a rewrite. I have done all the work in a separate git repo but I want to it all back to the original.

Is there a good way to do this so that it is obvious that this a new rewrite? Something like rename master and start a new master branch?

I don't really want the master logs to include the original and rewrite commits.

Edit/Solution:

I ended up moving the master branch to _master and created a new bare master. This was hard because gitlab was being obstructive. I had to make another branch the master before I could rename it.

I pushed the new repository to the master branch of this repo.

I now have a branch that has two distinct branches with everything working and it displays nicely in the network graph in gitlab. It is clear that master is not a continuation of the old code and is a rewrite.

Jim
  • 19
  • 3

2 Answers2

0

you might want to merge these two repository. here is a answer about how to do this:

How do you merge two Git repositories?

  • although I will still ask if I have rewritten everything and is better version why I need to worry about the old version.
Community
  • 1
  • 1
Deepak
  • 1,323
  • 2
  • 19
  • 38
  • We use gitlab to manage our repository, documentation and issues. The issues and doco tie back to specific code in the repository and this is useful information. – Jim Jun 15 '15 at 04:18
  • This link really helped but wasn't directly what I ended up doing. I've updated the question. Thanks for the help Shunya – Jim Jun 15 '15 at 07:10
0

Even if the code is fresh, it is still worth keeping the history in the repo. What I would do in this case is first add the.

What I would do is: first add a commit in the old version of the code that renames it such that it won't conflict with any of the files in the new version; then rebase the new version on top of that commit, then delete the old version of the code.

The man page for git rebase is likely to give you a headache at first, but it is the most useful git command ever.

o11c
  • 13,564
  • 4
  • 46
  • 66