Here's how I address this problem. When I'm developing, but before I create a PR, I'll create a bunch of stream-of-consciousness commits. This is stuff like "Fix typo" or "Minor formatting changes" mixed in with actual functional changes. Right before I create the PR, or push up a shared branch, I do an interactive rebase (git rebase -i). This allows me to organize my commits. I can squash commits, amend commits, mov…
I do this (kind of too), but instead of an interactive rebase I just do a `git reset --soft `, where target_branch is the local (and up-to-date) copy of my target branch. That gets me one clean commit that I can force push up to replace my branch @ remote. (This works for me because auditing commit history is not important where I work, if it were I would organize commits better.)
Ask HN: What is your Git commit/push flow?
101–110 of 201 posts
Re: Ask HN: What is your Git commit/push flow?
#102Here's how I address this problem. When I'm developing, but before I create a PR, I'll create a bunch of stream-of-consciousness commits. This is stuff like "Fix typo" or "Minor formatting changes" mixed in with actual functional changes. Right before I create the PR, or push up a shared branch, I do an interactive rebase (git rebase -i). This allows me to organize my commits. I can squash commits, amend commits, mov…
*glances and $corp git repo and sees 'updates' 'fix' 'updates'. Sigh.
Re: Ask HN: What is your Git commit/push flow?
#103Re: Ask HN: What is your Git commit/push flow?
#104Re: Ask HN: What is your Git commit/push flow?
#105Re: Ask HN: What is your Git commit/push flow?
#106Here is my last five commit messages: "width*height is area", "fixing stuff i broke", "rm properties we dont need", "rm more useless attributes", "nicer figures". I do my best to keep the code base as clean as possible, but I couldn't care less about keeping the commit history pretty. Any time spent on prettifying git history is better spent on documenting the existing* code imo.
Re: Ask HN: What is your Git commit/push flow?
#107Re: Ask HN: What is your Git commit/push flow?
#108Squash-merge PRs. You can configure this in GitLab, GitHub, and Azure DevOps. Your private commits can be whatever you want and they get rolled up to a single PR commit when your working branch is merged to trunk.