A Better Git Flow
render.com
A Better Git Flow
1–10 of 115 posts
Re: A Better Git Flow
#2Re: A Better Git Flow
#3I'm not sure this gives the right impression. Yes rename/squash/interactive rebase if necessary to tidy, however I still believe you should strive to create clear, separate commits as you go.
If you have to regularly make major changes to history before review, I could be a sign that your process/approach is disorganised.
Re: A Better Git Flow
#4Either way, in the end it's up to developer discipline to make clean commits, git doesn't really help all that much although in my (long) source control history before git I never thought of committing hunks.
Re: A Better Git Flow
#5When developing my priority is to easily get back to a last known working state. This allows me to try out risky changes, and throw them all away if it doesn't work out.
When pushing my changes for PR, those working states I saved before may not be the best logically. I usually re-write my commits to break it into more logical chunks, that are easy to revert and easier for other teammates to digest.
Re: A Better Git Flow
#6Re: A Better Git Flow
#7Re: A Better Git Flow
#8uhh...git rebase -i anyone?
Re: A Better Git Flow
#9For example,
Most of one core change is in multiple files, it will be very bad to commit by files group
Re: A Better Git Flow
#10I use GitHub and always squash commits before merging a PR. This keeps the commit log clean and also has the side effect that you have the PR number in the merge commit.
Having said that I also suggest keeping PRs small. If you are going to reformat a code base, make that a separate commit. Updating a library, separate commit. Adding a library you need for a new feature: create a PR for the library update, base your implementation off that branch and rebase against main when the first PR is merged.