Skip to content

Commit 5861c1b

Browse files
committed
add git-interactive-merge script
this script allows "merging branches", but uses the interactive rebase feature to allow you to (de)select (and modify) commits before merging taken from http://stackoverflow.com/questions/449541/how-do-you-merge-selective-files-with-git-merge written by '1800 INFORMATION' (minor edits by me)
1 parent 711c329 commit 5861c1b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

git-interactive-merge

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
if [ -z "$1" -o -z "$2" ]
3+
then
4+
echo "usage: $0 <from> <to>" >&2
5+
exit 2
6+
fi
7+
from=$1
8+
to=$2
9+
git checkout $from
10+
git checkout -b ${from}_tmp
11+
# drops you in an editor, pick the changes you want
12+
git rebase -i $to
13+
git checkout $to
14+
git pull . ${from}_tmp
15+
git branch -d ${from}_tmp

0 commit comments

Comments
 (0)