Fixes #8032
[doc][trivial] Add basic git squash workflow [skip ci] #8034
pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:contrib-squash changing 1 files +21 −7-
fanquake commented at 6:40 AM on May 10, 2016: member
- fanquake force-pushed on May 10, 2016
-
in CONTRIBUTING.md:None in 8af1606e6e outdated
45 | 46 | -At this stage one should expect comments and review from other contributors. You can add more commits to your pull request by committing them locally and pushing to your fork until you have satisfied all feedback. If your pull request is accepted for merging, you may be asked by a maintainer to squash and or rebase your commits before it will be merged. The length of time required for peer review is unpredictable and will vary from patch to patch. 47 | +At this stage one should expect comments and review from other contributors. You can add more commits to your pull request by committing them locally and pushing to your fork until you have satisfied all feedback. If your pull request is accepted for merging, you may be asked by a maintainer to squash and or [rebase](https://git-scm.com/docs/git-rebase) your commits before it will be merged. The basic squashing workflow is shown below. 48 | + 49 | + git checkout your_branch_name 50 | + git rebase -i commit_shasum
MarcoFalke commented at 6:46 AM on May 10, 2016:What is
commit_shasum?Maybe
HEAD~n?
jonasschnelli commented at 7:22 AM on May 10, 2016:Maybe
git rebase -i HEAD~<amount of commits to squash>Maybe add something like (please clean/rewrite the english)
Use `p` at the beginning of the line to indicate the commit you wish to use as the base commit Use `s` at the beginning of the line for all commits you want to squash into the commit you have marked with `p`.
laanwj commented at 7:36 AM on May 10, 2016:git rebase -i HEAD~<amount of commits to squash>
It's not the number of commits to squash, but at least that amount +1, as you need a base commit too to squash into. Usually more like the total number of commits in someone's PR that they want to edit.
I haven't found a really user friendly way to determine this base commit yet, which is why I usually look it up for people. HEAD~x may be best, but is also something to get wrong easily if you miscount.
MarcoFalke commented at 7:47 AM on May 10, 2016:For me, git will tell me what the commands are when I am doing the rebase:
# Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shellin CONTRIBUTING.md:None in 8af1606e6e outdated
48 | + 49 | + git checkout your_branch_name 50 | + git rebase -i commit_shasum 51 | + # set commits from 'pick' to 'squash' 52 | + # save and quit the editor 53 | + git push -f (force push to GitHub)
MarcoFalke commented at 6:46 AM on May 10, 2016:nit: missing
#after-f. (or leave the comment away)MarcoFalke commented at 6:49 AM on May 10, 2016: memberIt might be worth to mention that squashing is not required when the commits each have a different "topic"/task and are not fixup commits.
Also, it might come in handy to add section headings, so it is easier to link to a section...
Concept ACK.
MarcoFalke added the label Docs and Output on May 10, 2016laanwj commented at 7:32 AM on May 10, 2016: memberConcept ACK, this was long overdue, somehow I was not lazy enough describe this again in every new contributor's pull, but too lazy to add it into here :) Thanks for doing so.
[doc] Add basic git squash example 90963e5370in CONTRIBUTING.md:None in 8af1606e6e outdated
47 | +At this stage one should expect comments and review from other contributors. You can add more commits to your pull request by committing them locally and pushing to your fork until you have satisfied all feedback. If your pull request is accepted for merging, you may be asked by a maintainer to squash and or [rebase](https://git-scm.com/docs/git-rebase) your commits before it will be merged. The basic squashing workflow is shown below. 48 | + 49 | + git checkout your_branch_name 50 | + git rebase -i commit_shasum 51 | + # set commits from 'pick' to 'squash' 52 | + # save and quit the editor
laanwj commented at 7:36 AM on May 10, 2016:After this, they'll get another editor in which they can combine/refine the commit messages.
fanquake force-pushed on May 10, 2016fanquake renamed this:[doc][trivial] Add basic git squash workflow
[doc][trivial] Add basic git squash workflow [skip ci]
on May 10, 2016laanwj commented at 9:08 AM on May 10, 2016: memberBTW: the [skip ci] did'n't work. I think you need to put it in the commit message, unfortunately. (doesn't have to be in the first line though, luckily)
MarcoFalke commented at 12:40 PM on May 10, 2016: memberutACK 90963e5
paveljanik commented at 1:27 PM on May 10, 2016: contributorachow101 commented at 12:20 PM on May 11, 2016: memberutACK 90963e5
petertodd commented at 1:59 PM on May 20, 2016: contributorpaveljanik commented at 5:50 AM on May 24, 2016: contributorThis is ready for merge.
arowser commented at 8:43 AM on May 25, 2016: contributorCan one of the admins verify this patch?
laanwj merged this on May 26, 2016laanwj closed this on May 26, 2016laanwj referenced this in commit e3a820751f on May 26, 2016fanquake deleted the branch on May 26, 2016codablock referenced this in commit fff085dfab on Sep 16, 2017codablock referenced this in commit 8dff1eeeaf on Sep 19, 2017codablock referenced this in commit 9bf6987933 on Dec 21, 2017DrahtBot locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:15 UTC
More mirrored repositories can be found on mirror.b10c.me