git: keeping repos in sync despite chopped history -


Background: I'm in the process of clearing a project before releasing it as an open source. During code history, I did not really want to show any public repository (in the comment, the harsh harsh path, the embarrassing piece of code), so I want to see the public after code base, point of cleanliness - even then I want to maintain complete history in my own private repository.

After the cutoff point, private and public treasures are being fully synchronized. Apart from local non-pushing temporary branches, there will be no private branch; The master branch on both the repositories should be equal, except that the public history is cut off at the cut-off point.

As far as I can tell that the git requires repository with full history, I can not directly my local master branch in both public and private treasures Pushing I think it would be possible to create a separate 'public' branch and rewrite history, but before sending the code to the repositories the private branch will need to be made public - I need to A backup is needed which may at least require manual work.

The purpose of the public repository is to bridge, integrating with me will be done on my Linux server, private repository will be hosted, so to set up to auto-merge in different (public) repos It could be possible and then press the public repo. I hope the cleaner is a solution, though - maybe there is a method of structure that I did not think.

Thanks in advance for any suggestions :)

Update 1

Trying to follow Voncani's recommendations, it is that I have not yet Have done this:

Concepts: Private repositories have been cleaned, locally committed, and pushed to git @ server: private.git. Public repositories created with files from local private commitments are locally committed, and pushed to git @ server: public.git.

1) ~ / priv $ git Add public git to remote server: public .git 2) ~ / priv $ git fetch public

WARNING: No common committance (baggage beacon) * [new branch] master -> public / master

3) ~ / priv $ Git log --format = '% h% s'

d2d66cf2861ac7136ee3dc04467781825413b084 Clear up code base, ready for public!

The top hash (d2d66 ...) is a private head commit.

4) ~ / private $ git log --reverse --format = '% h% s 'Public / master

090a335746ecb03ea5362909be4969b87a99ab80 The first public committed! C43fccdda05319e57498f4f517650f9edbdb942a Second Public Committed :)

Due to the --reverse, the oldest hash (090a3 ...) is at the top.

5) ~ / Private $ echo '090a335746ecb03ea5362909b4969b87a99ab80d2d66cf2861ac7136ee3dc04467781825413b084' & gt; & Gt; At this point, git log public / master shows the revised history, but I'm sure how the filter for wrt progresses- The branch and all these ... I have only been successful in chatting things :)

Once you have your own Cleaned up, you can make a new repo with only one commod ("clean" one), which you will put in your public repo.

By leaving locally, you will have two repos

  • Make a mirror that the new (and small) public report
  • Along with, where you can. In this, you get full history.

Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -