Git squash is committed to a shared server, but contains detailed commits for a private server

I am writing an open source library. I use two remote controls: one personal repo for a personal test bench and backup, and another publication is posted on github.

In a private repo, this is the place where I save and make a lot of commits and click on all the small changes, such as “fixed spelling” or “still working on bug No. 123!”. This is wonderful, and I would like to keep it that way. Private repo will never be available to anyone.

In a public repo on github, I want my git storage history to be clean. Combining multiple commits into one commit, for example. "Fixed bug number 123."

The question is, how do I maintain two separate git stories on two different remote repositories?

I read articles on git rebase. Would change the whole story of this thread rebase? If I reinstall the history of the public repo, will the private repo also be redistributed?

Would it be better if I supported two branches? Is it possible that the public server sees only one branch (as the leading one), and the other sees both branches with detailed commits?

I'm not sure what the best practices would be for this situation. Thank you for your time.

+5
source share
1 answer

The question is, how do I maintain two separate git stories on two different remote repositories?

, . , ( , ), git rebase develop ..

, , . , ? , .

:

  • ;

  • , develop ( , ), .

  • , , , , .

, , , .

:

, , - :

  • , . git diff ${SHA}, ${SHA} - , .
  • diff > patch.diff.
  • ${SHA} git checkout ${SHA}.
  • patch -p1 < patch.diff.
  • git commit -m '...'.
  • , , git branch -m.
  • git push ${REMOTE_NAME} ${BRANCH_NAME}.
  • Reset git reset HEAD~1.

, : [

+4

All Articles