Browse Source

check if git already init

master
Robin Thoni 8 years ago
parent
commit
e480cb4ce0
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      git-backup

+ 6
- 1
git-backup View File

4
 
4
 
5
 initPath()
5
 initPath()
6
 {
6
 {
7
-  cd "$1" && git init && git remote add origin git:backup/$(hostname)$(pwd | tr '/' '-')
7
+  cd "$1" &&
8
+  if [ ! -e .git ]
9
+  then
10
+    git init &&
11
+    git remote add origin git:backup/$(hostname)$(pwd | tr '/' '-')
12
+  fi
8
 }
13
 }
9
 
14
 
10
 if [ $# -eq 1 ] && [ "$1" = "--init" ]
15
 if [ $# -eq 1 ] && [ "$1" = "--init" ]

Loading…
Cancel
Save