Live data from Hacker News

Squash your commits

github.com

1–10 of 350 posts

Re: Squash your commits

#3
This is a feature I've wanted for such a long time. While it's perfectly feasible to do through the command line, I've always found myself having to force push to update the history on github's side of things.

I typically did it through git rebase -i HEAD~N, so maybe someone here on HN knows of a better way to squash a commit whenever you're updating remote history. Albeit, it seems that updating remote history with a squashed commit isn't entirely attractive behavior and that's why I was forced to force push.

Re: Squash your commits

#9
I mentioned this in a tweet[0] but we have a quasi-tradition of shipping on April 1st:

* https://github.com/blog/1815-l-is-for-labels

* https://github.com/blog/1451-branch-and-tag-labels-for-commi...

* https://github.com/blog/626-announcing-svn-support

[0]: https://twitter.com/gjtorikian/status/715972348860633088

Re: Squash your commits

#10
This is a bad idea masquerading as a good idea. Before making a pull request (or doing any sort of merge), you should rebase against upstream master (or whatever you're going to push to). However, keeping distinct atomic commits that change one and only one small thing, when possible, is much preferable if bisect or blame is used. If you have broken or poorly written commits, use fixup, reword, squash, etc. in rebase -i.

Using fast-forward (and possibly only allowing fast-forward) is a good idea. Squashing entire pull requests that may change multiple things into a single commit is a very bad idea.

Post reply on HN