Skip to content

Commit fbddba0

Browse files
committed
Teach 'git pull' to handle --rebase=interactive
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 26f3888 commit fbddba0

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Documentation/git-pull.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Options related to merging
104104
include::merge-options.txt[]
105105

106106
-r::
107-
--rebase[=false|true|preserve]::
107+
--rebase[=false|true|preserve|interactive]::
108108
When true, rebase the current branch on top of the upstream
109109
branch after fetching. If there is a remote-tracking branch
110110
corresponding to the upstream branch and the upstream branch
@@ -116,6 +116,8 @@ to `git rebase` so that locally created merge commits will not be flattened.
116116
+
117117
When false, merge the current branch into the upstream branch.
118118
+
119+
When `interactive`, enable the interactive mode of rebase.
120+
+
119121
See `pull.rebase`, `branch.<name>.rebase` and `branch.autoSetupRebase` in
120122
linkgit:git-config[1] if you want to make `git pull` always use
121123
`--rebase` instead of merging.

git-pull.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ do
138138
;;
139139
--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
140140
rebase=false
141+
141142
;;
142143
--recurse-submodules)
143144
recurse_submodules=--recurse-submodules
@@ -178,14 +179,18 @@ do
178179
done
179180

180181
case "$rebase" in
182+
i|interactive)
183+
rebase=true
184+
rebase_args=-i
185+
;;
181186
preserve)
182187
rebase=true
183188
rebase_args=--preserve-merges
184189
;;
185190
true|false|'')
186191
;;
187192
*)
188-
echo "Invalid value for --rebase, should be true, false, or preserve"
193+
echo "Invalid value for --rebase, should be true, false, interactive or preserve"
189194
usage
190195
exit 1
191196
;;

0 commit comments

Comments
 (0)