Skip to content

Commit a79bb0f

Browse files
committed
Added remove, track-branch and filemerge
1 parent 6ba3184 commit a79bb0f

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

git-filemerge

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
if test $# = 0; then
3+
OLD=`git write-tree`
4+
elif test "$1" = --cached; then
5+
OLD=HEAD
6+
NEW=`git write-tree`
7+
shift
8+
fi
9+
if test $# -gt 0; then
10+
OLD="$1"; shift
11+
fi
12+
test $# -gt 0 && test -z "$CACHED" && NEW="$1"
13+
TMPDIR1=`mktemp -d`
14+
git archive --format=tar $OLD | (cd $TMPDIR1; tar xf -)
15+
if test -z "$NEW"; then
16+
TMPDIR2=$(git rev-parse --show-cdup)
17+
test -z "$cdup" && TMPDIR2=.
18+
else
19+
TMPDIR2=`mktemp -d`
20+
git archive --format=tar $NEW | (cd $TMPDIR2; tar xf -)
21+
fi
22+
23+
opendiff $TMPDIR1 $TMPDIR2 | cat
24+
rm -rf $TMPDIR1
25+
test ! -z "$NEW" && rm -rf $TMPDIR2
26+

git-remove

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
git ls-files --deleted -z | xargs -0 git rm

git-track-branch

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
branch_name=$1
4+
git checkout --track -b ${branch_name} origin/${branch_name}

0 commit comments

Comments
 (0)