Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you are doing squash merges, git branches have a cost.


A git branch is literally a file with a commit hash in it. It's conceptually a pointer to a commit. Creating, destroying, and maintaining a branch has all the overhead of a ~40 byte file.

Squash merges leave a ton of commits just floating in your old branch. If you delete the branch (the 40B file), all those commits are still there. Doing lots of squash merges brings you into this case I mentioned:

> If you have a weird branching strategy where you maintain multiple, significantly diverged branches at once, but only care about one of those branches at build time, then this optimization would save you time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: