Skip to content

Commit c0c315c

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

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
@@ -117,6 +117,8 @@ locally created merge commits will not be flattened.
117117
+
118118
When false, merge the current branch into the upstream branch.
119119
+
120+
When `interactive`, enable the interactive mode of rebase.
121+
+
120122
See `pull.rebase`, `branch.<name>.rebase` and `branch.autosetuprebase` in
121123
linkgit:git-config[1] if you want to make `git pull` always use
122124
`--rebase` instead of merging.

git-pull.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ do
135135
;;
136136
--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
137137
rebase=false
138+
138139
;;
139140
--recurse-submodules)
140141
recurse_submodules=--recurse-submodules
@@ -175,14 +176,18 @@ do
175176
done
176177

177178
case "$rebase" in
179+
i|interactive)
180+
rebase=true
181+
rebase_args=-i
182+
;;
178183
preserve)
179184
rebase=true
180185
rebase_args=--preserve-merges
181186
;;
182187
true|false|'')
183188
;;
184189
*)
185-
echo "Invalid value for --rebase, should be true, false, or preserve"
190+
echo "Invalid value for --rebase, should be true, false, interactive or preserve"
186191
usage
187192
exit 1
188193
;;

0 commit comments

Comments
 (0)