forked from coordt/git-scripts
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-export
More file actions
Latest commit
executable file
·24 lines (21 loc) · 466 Bytes
/
Copy pathgit-export
File metadata and controls
executable file
·24 lines (21 loc) · 466 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
#
# Called as git export <commit-reference> [<filename>]
#
# Performs a git-archive, gzips it and names it <commit-reference>.tar.gz
# or names it <filename> if included.
if [ -z$1 ]
then
echo"You need to specify a commit-reference to export."
echo"Usage: git export commit-reference [filename]"
exit 1
else
COMMIT=$1
fi
if [ -z$2 ]
then
FILENAME="$COMMIT.tar.gz"
else
FILENAME=$2
fi
git archive $COMMIT| gzip >$FILENAME