3 ms·
I'm referring to the squash feature of git rebase. The developer collapsed years of commits into one before pushing to GitHub, I am wondering if there is a way
by hobo_mark 6y ago
I'm referring to the squash feature of git rebase. The developer collapsed years of commits into one before pushing to GitHub, I am wondering if there is a way to keep working on top of the original history privately, and pushing to the "clean" history on GitHub, without having to cherry-pick all new commits for GitHub by hand.
- wadim 6y agoI guess the "easiest" solution would be a clean and separate "github" directory where no work happens and where you just cp all your changes from your actual working directory into. If they version it, I could also imagine using master as an orphan branch and just cherry-pick the changes between two tags or commits into it.
- mook 6y agogit replace¹ should be able to do it; otherwise, grafts² work too. ¹ https://git-scm.com/docs/git-replace https://git-scm.com/docs/git-replace ² https://git.wiki.kernel.org/index.php/GraftPoint https://git.wiki.kernel.org/index.php/GraftPoint
- hobo_mark 6y agoThat is it! Fantastic, thanks! https://git-scm.com/book/en/v2/Git-Tools-Replace https://git-scm.com/book/en/v2/Git-Tools-Replace gives the exact example of what I had in mind.