问题
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