intended workflow when interacting with a git repository, specifically for github PRs where upstream doesn't like you force-pushing #411
-
My
What is the expected corresponding
The third step in particular seems cumbersome compared to the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 16 replies
-
Good question! I know that many (probably even most) GitHub projects want you to address code review comments by adding new commits on top. These projects typically integrate PRs by merging or squashing. In this project, we instead amend commits and try to keep a single commit per logical change and then integrate PRs by rebasing. That matches what e.g. the Git and Mercurial projects require (w.r.t. keeping commits clean - the Git project integrates features by merging), and also what we do internally at Google with the Fig tool. There can still be multiple commits per PR, although I only do that to work around GitHub's poor support for stacked PRs (I still expect each commit to be reviewed on its own). Incidentally, there was a post on GitHub's blog today about the commit-per-logical-change workflow. It's good to see that at least a few people at GitHub care about this workflow. Since we use the commit-per-logical-change workflow in this project, I typically don't create a branch until I'm ready to send the commit(s) for review, which I the do with To address review feedback, I check out the commit, make the changes and run Once the PR has been merged, I run Anyway, if the GitHub project you're contributing to uses the squash/merge workflow (where PRs matter and commits don't matter much), I think what you're currently doing is unfortunately the best you can currently do. Well, you could drop the Perhaps we should add a way of having a current branch like Git has. Perhaps being able to do something like |
Beta Was this translation helpful? Give feedback.
Good question! I know that many (probably even most) GitHub projects want you to address code review comments by adding new commits on top. These projects typically integrate PRs by merging or squashing. In this project, we instead amend commits and try to keep a single commit per logical change and then integrate PRs by rebasing. That matches what e.g. the Git and Mercurial projects require (w.r.t. keeping commits clean - the Git project integrates features by merging), and also what we do internally at Google with the Fig tool. There can still be multiple commits per PR, although I only do that to work around GitHub's poor support for stacked PRs (I still expect each commit to be review…