We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33f4612 commit 3a6b211Copy full SHA for 3a6b211
docs/dev/git.md
@@ -393,13 +393,20 @@ git checkout feature
393
git rebase master
394
```
395
396
-通过如下设置,可以使得 `rebase` 成为默认行为:
+如果你或者你的团队对线性历史有需求,通过如下设置,可以使得 `rebase` 成为 `git pull` 时候的默认行为。这样可以防止与其他人在同一分支合作时,出现大量的 merge commit:
397
398
```ini
399
[pull]
400
rebase = true
401
402
403
+或者也可以限制 `git pull` 只能进行 fast-forward,在出现分叉时用户可以手动 `git pull --rebase`,或者使用其他解决的方式:
404
+
405
+```ini
406
+[pull]
407
+ ff = only
408
+```
409
410
!!! question "更新一个有修改的本地仓库"
411
412
以下是一个现实的例子:某个代码 git 仓库(存储在 GitHub 上)的 `master` 分支部署在一台服务器上,并且在该服务器上不仅做了一些额外的 commit 用来记录一些服务器相关的配置,还有一些没有被 stage 的文件。现在该代码仓库在 GitHub 上的 `master` 分支有一些新的更新 commit(例如更新了依赖,修复了 bug 等),那么如何将这些 commit 部署在该服务器上呢?
0 commit comments