How can I separate git commits / git history from personal (private) and public. I have several computers and I often switch between them. In order to have the latest code available I very often do commits on one computer, and then pull it on another computer. This causes a very ugly commit history, which doesn't make sense, and therefore I don't want these commits to be in the history when I push a new version to a public git repository. What is the correct approach here?
-
2First approach: don't worry about it, no one else does. Alternatively: rebase interactively and squash/rearrange/retitle your commits as desired before pushing to public.. Note that the second one implies rewriting the history which has some annoying side effects.Joachim Sauer– Joachim Sauer2023-12-14 09:29:27 +00:00Commented Dec 14, 2023 at 9:29
-
Interactive rebasing and squashing commits is completely fine, but be cautious with rewriting history if your commits are already pushed to a shared repository. It can cause issues for others who have pulled the original historyevolutionxbox– evolutionxbox2023-12-14 09:38:37 +00:00Commented Dec 14, 2023 at 9:38
Add a comment
|