开发者

Creating a branch containing changes between two codebases?

I made an open source release based on a codebase which contained unfinished refactoring and other misc changes. Unfortunately it turned out to take a lot more work than expected and so now I am considering re-releasing the last stable codebase, and make a new branch that would contain any changes I did since.

How would you go about that, short of manually checking every single file one by one?

Thinking aloud:

Would it be possible somehow to initialize git on the old codebase, then create a new branch开发者_StackOverflow社区, then copy over the 'refactoring' codebase on top of the stable codebase (in my local git repository), and then git would detect all changes if I type 'git st' ? Would there be substantial flaws in that?

PS: - the open source release is very recent, nobody contributed yet which would make it possible to re-release in a better format - my dilemma here, is that I didn't use version control until sometime after I started the refactoring..


What you suggested would work fine, though this may be easier and avoid messing with your working copy.

  1. git init in your old codebase
  2. copy the .git directory into your new, refactored code directory
  3. git checkout -b new-branch
  4. git commit -am 'refactoring'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜