Skip to content

Commit d337c9d

Browse files
authored
Merge pull request #4827 from RPing/patch-1
Update github-workflow.md
2 parents 6f0e800 + 86c8508 commit d337c9d

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
@@ -96,7 +96,7 @@ Please don't use `git pull` instead of the above `fetch` / `rebase`. `git pull`
9696
does a merge, which leaves merge commits. These make the commit history messy
9797
and violate the principle that commits ought to be individually understandable
9898
and useful (see below). You can also consider changing your `.git/config` file via
99-
`git config branch.autoSetupRebase always` to change the behavior of `git pull`.
99+
`git config branch.autoSetupRebase always` to change the behavior of `git pull`, or another non-merge option such as `git pull --rebase`.
100100

101101
### 5 Commit
102102

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

161161
1. Check your git branch:
162-
162+
163163
```
164164
git status
165165
```
166-
166+
167167
Output is similar to:
168-
168+
169169
```
170170
On branch your-contribution
171171
Your branch is up to date with 'origin/your-contribution'.
172172
```
173-
174-
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.
173+
174+
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.
175175

176176
```
177177
git rebase -i HEAD~3
178178
```
179-
180-
Output is similar to:
181-
179+
180+
Output is similar to:
181+
182182
```
183183
pick 2ebe926 Original commit
184184
pick 31f33e9 Address feedback
@@ -192,31 +192,31 @@ rebase](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History):
192192
# e, edit <commit> = use commit, but stop for amending
193193
# s, squash <commit> = use commit, but meld into previous commit
194194
# f, fixup <commit> = like "squash", but discard this commit's log message
195-
195+
196196
...
197-
197+
198198
```
199199

200-
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:
200+
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:
201201

202202
```
203203
pick 2ebe926 Original commit
204204
squash 31f33e9 Address feedback
205205
pick b0315fe Second unit of work
206-
206+
207207
...
208-
208+
209209
```
210-
211-
Output (after saving changes) is similar to:
212-
210+
211+
Output (after saving changes) is similar to:
212+
213213
```
214214
[detached HEAD 61fdded] Second unit of work
215215
Date: Thu Mar 5 19:01:32 2020 +0100
216216
2 files changed, 15 insertions(+), 1 deletion(-)
217-
217+
218218
...
219-
219+
220220
Successfully rebased and updated refs/heads/master.
221221
```
222222
4. Force push your changes to your remote branch:
@@ -231,7 +231,7 @@ masse. This makes reviews easier.
231231

232232
### Merging a commit
233233

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

236236
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.
237237

0 commit comments

Comments
 (0)