Skip to content

Commit 1e04d46

Browse files
authored
Merge pull request progit#1153 from limdor/fix_rebase_explanation
Clarify when is not recommended to rebase
2 parents ef6c766 + b6ed44d commit 1e04d46

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

book/03-git-branching/sections/rebasing.asc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ image::images/interesting-rebase-5.png[Final commit history.]
137137
(((rebasing, perils of)))
138138
Ahh, but the bliss of rebasing isn't without its drawbacks, which can be summed up in a single line:
139139

140-
*Do not rebase commits that exist outside your repository.*
140+
*Do not rebase commits that exist outside your repository and people may have based work on them.*
141141

142142
If you follow that guideline, you'll be fine.
143143
If you don't, people will hate you, and you'll be scorned by friends and family.
@@ -208,7 +208,8 @@ Or you could do it manually with a `git fetch` followed by a `git rebase teamone
208208

209209
If you are using `git pull` and want to make `--rebase` the default, you can set the `pull.rebase` config value with something like `git config --global pull.rebase true`.
210210

211-
If you treat rebasing as a way to clean up and work with commits before you push them, and if you only rebase commits that have never been available publicly, then you'll be fine.
211+
If you only ever rebase commits that have never left your own computer, you'll be just fine.
212+
If you rebase commits that have been pushed, but that no one else has based commits from, you'll also be fine.
212213
If you rebase commits that have already been pushed publicly, and people may have based work on those commits, then you may be in for some frustrating trouble, and the scorn of your teammates.
213214

214215
If you or a partner does find it necessary at some point, make sure everyone knows to run `git pull --rebase` to try to make the pain after it happens a little bit simpler.

0 commit comments

Comments
 (0)