Run “git pull --rebase” in interactive mode?

巧了我就是萌 提交于 2019-11-27 05:58:09

问题


Is it possible to run the command git pull --rebase in an interactive mode (like git rebase -i)?


回答1:


Original answer (April 2015)

Not really, considering a git pull --rebase is not the same as a git fech + git rebase.
See what does "git pull --rebase" do?


Update January 2016

Git 2.8 (March 2016) will allows to have a pull --rebase interactive!

See commit 17c4ddb, commit b5496d4, commit f5eb87b (13 Jan 2016) by Johannes Schindelin (dscho).
(Merged by Junio C Hamano -- gitster -- in commit f9219c0, 26 Jan 2016)

pull: allow interactive rebase with --rebase=interactive

A couple of years ago, I found the need to collaborate on topic branches that were rebased all the time, and I really needed to see what I was rebasing when pulling, so I introduced an interactively-rebasing pull.

The way builtin pull works, this change also supports the value 'interactive' for the 'branch.<name>.rebase' config variable, which is a neat thing because users can now configure given branches for interactively-rebasing pulls without having to type out the complete --rebase=interactive option every time they pull.


Update August 2018, Git 2.19:

"git pull --rebase=interactive" learned "i" as a short-hand for "interactive".

See commit 46af44b (04 Aug 2018) by Johannes Schindelin (dscho).
(Merged by Junio C Hamano -- gitster -- in commit c757aa2, 17 Aug 2018)

pull --rebase=<type>: allow single-letter abbreviations for the type

'Git for Windows' original 4aa8b8c (Teach 'git pull' to handle --rebase=interactive, 2011-10-21) had support for the very convenient abbreviation

git pull --rebase=i

which was later lost when it was ported to the builtin git pull, and it was not introduced before the patch eventually made it into Git as f5eb87b (pull: allow interactive rebase with --rebase=interactive, 2016-01-13, Git 2.8.0).

However, it is really a useful short hand for the occasional rebasing pull on branches that do not usually want to be rebased.

So let's reintroduce this convenience, at long last.



来源:https://stackoverflow.com/questions/29717502/run-git-pull-rebase-in-interactive-mode

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!