public
Description: Collection of scripts for performing generic git tasks
Clone URL: git://github.com/farktronix/gittools.git
Search Repo:
gittools / git-export
100755 25 lines (19 sloc) 0.379 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
 
# git-export
# Jacob Farkas <jacobf@rkas.net>
# Exports the current branch to the given directory
 
if [ -z "$1" ]; then
echo "usage: git-export [rev] path"
    exit 1
fi
 
if [ "$#" == "1" ]; then
path=$1
    rev="HEAD"
else
rev=$1
    path=$2
fi
 
if [ ! -e "$path" ]; then
mkdir -p "$path"
fi
 
git-archive --format=tar $rev | (tar xf - -C "$path")