Skip to content

Commit 86c8508

Browse files
committed
Update github-workflow.md
1 parent 2d6b374 commit 86c8508

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

contributors/guide/github-workflow.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Please don't use `git pull` instead of the above `fetch` / `rebase`. `git pull`
9393
does a merge, which leaves merge commits. These make the commit history messy
9494
and violate the principle that commits ought to be individually understandable
9595
and useful (see below). You can also consider changing your `.git/config` file via
96-
`git config branch.autoSetupRebase always` to change the behavior of `git pull`.
96+
`git config branch.autoSetupRebase always` to change the behavior of `git pull`, or another non-merge option such as `git pull --rebase`.
9797

9898
### 5 Commit
9999

@@ -156,26 +156,26 @@ To squash your commits, perform an [interactive
156156
rebase](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History):
157157

158158
1. Check your git branch:
159-
159+
160160
```
161161
git status
162162
```
163-
163+
164164
Output is similar to:
165-
165+
166166
```
167167
On branch your-contribution
168168
Your branch is up to date with 'origin/your-contribution'.
169169
```
170-
171-
2. Start an interactive rebase using a specific commit hash, or count backwards from your last commit using `HEAD~<n>`, where `<n>` represents the number of commits to include in the rebase.
170+
171+
2. Start an interactive rebase using a specific commit hash, or count backwards from your last commit using `HEAD~<n>`, where `<n>` represents the number of commits to include in the rebase.
172172

173173
```
174174
git rebase -i HEAD~3
175175
```
176-
177-
Output is similar to:
178-
176+
177+
Output is similar to:
178+
179179
```
180180
pick 2ebe926 Original commit
181181
pick 31f33e9 Address feedback
@@ -189,31 +189,31 @@ rebase](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History):
189189
# e, edit <commit> = use commit, but stop for amending
190190
# s, squash <commit> = use commit, but meld into previous commit
191191
# f, fixup <commit> = like "squash", but discard this commit's log message
192-
192+
193193
...
194-
194+
195195
```
196196

197-
3. Use a command line text editor to change the word `pick` to `fixup` for the commits you want to squash, then save your changes and continue the rebase:
197+
3. Use a command line text editor to change the word `pick` to `fixup` for the commits you want to squash, then save your changes and continue the rebase:
198198

199199
```
200200
pick 2ebe926 Original commit
201201
squash 31f33e9 Address feedback
202202
pick b0315fe Second unit of work
203-
203+
204204
...
205-
205+
206206
```
207-
208-
Output (after saving changes) is similar to:
209-
207+
208+
Output (after saving changes) is similar to:
209+
210210
```
211211
[detached HEAD 61fdded] Second unit of work
212212
Date: Thu Mar 5 19:01:32 2020 +0100
213213
2 files changed, 15 insertions(+), 1 deletion(-)
214-
214+
215215
...
216-
216+
217217
Successfully rebased and updated refs/heads/master.
218218
```
219219
4. Force push your changes to your remote branch:
@@ -228,7 +228,7 @@ masse. This makes reviews easier.
228228

229229
### Merging a commit
230230

231-
Once you've received review and approval, your commits are squashed, your PR is ready for merging.
231+
Once you've received review and approval, your commits are squashed, your PR is ready for merging.
232232

233233
Merging happens automatically after both a Reviewer and Approver have approved the PR. If you haven't squashed your commits, they may ask you to do so before approving a PR.
234234

0 commit comments

Comments
 (0)