|
|
|
|
|
by ktross
1772 days ago
|
|
I agree with the idea, but disagree with the approach. This seems like a lot of extra work for not much, or maybe even less, benefit. The process I've set up for my team allows us to get the best of both worlds, in my opinion, with almost no extra effort: 1. Create a branch and open a pull request. Nothing gets pushed directly to master. 2. After the pull request has been tested and reviewed, we Squash and Merge into master on GitHub with a single button click. This way we end up with a single commit in master for each feature, bugfix, etc. There's also a link to the PR in the commit message where you can view the individual commits that were squashed as well as links to any related Jira issues. |
|
Squash/rebase also plays horrendously with my local branches. If I make a PR, I should be able to use `git branch -d branch_name` to safely verify that the branch has been merged into main and can be deleted. If you squash/rebase instead, then I need to use the unconditional `git branch -D branch_name`. git can no longer verify that I'm performing a safe operation, because the history needed to determine whether it is safe has been rewritten.