aboutsummaryrefslogtreecommitdiffstats
path: root/dgbuilder/git_scripts/gitcurbranch
diff options
context:
space:
mode:
Diffstat (limited to 'dgbuilder/git_scripts/gitcurbranch')
-rwxr-xr-xdgbuilder/git_scripts/gitcurbranch13
1 files changed, 13 insertions, 0 deletions
diff --git a/dgbuilder/git_scripts/gitcurbranch b/dgbuilder/git_scripts/gitcurbranch
new file mode 100755
index 00000000..5a82e483
--- /dev/null
+++ b/dgbuilder/git_scripts/gitcurbranch
@@ -0,0 +1,13 @@
+if [ "$#" != "1" ]
+then
+ echo "Usage $0 gitLocalRepositoryDir"
+ exit
+fi
+localGitRepository=$1
+cd $localGitRepository
+if [ -e "$localGitRepository" ]
+then
+ git rev-parse --abbrev-ref HEAD
+else
+ echo Git Local repository not set
+fi