Set u+x on scripts.
[git-central.git] / scripts / push
1 #!/bin/sh
2 #
3 # Makes push "just work" by only pushing the current branch to origin.
4 #
5
6 branch_name=$(git symbolic-ref --quiet HEAD)
7 if [[ $? -ne 0 ]] ; then
8         echo "Not on a branch"
9         exit 1
10 fi
11
12 branch_name=${branch_name/refs\/heads\//}
13
14 git push origin $branch_name
15 if [[ $? -ne 0 ]] ; then
16         exit $?
17 fi
18
19 # ...tags...
20