chore(u/p/bktemp-parseArgs):Add version number
[BK-2020-03.git] / unitproc / bktemp-initGitRepo
index 905e9291bebe59548d0d2d018f6aa499c17f5033..3e4b5663c65314c2d72ba9cf588a9f4d91874c65 100644 (file)
@@ -31,11 +31,15 @@ initGitRepo() {
     #        arg2: repoDir
     #        arg3: remoteName
     #        arg4: branchName
-    # Version: 0.0.5
+    # Version: 0.0.7
     # Depends: checkURL() 0.0.2, yell(), Bash 5.0.3
     # Ref/Attrib: [1]: Test for space-less alphanuemric string. https://unix.stackexchange.com/a/416120
     #             [2]: Test for argument count. https://stackoverflow.com/q/18568706
     #             [3]: Test if dir is (in) git repository. https://stackoverflow.com/a/39518382
+    # Note: Pulls use '--ff-only' option which requires an upstream branch be set.
+    #   This can be done by using:
+    #     $ git branch --set-upstream-to origin/master master
+    # 
     #==BEGIN Validate input arguments==
     arg1="$1";
     arg2="$2";
@@ -68,15 +72,15 @@ initGitRepo() {
     else
        yell "STATUS:Already a git repository:$repoDir";
        git status; git remote -v;
-       yell "STATUS:Pausing 4 seconds..."; sleep 4;
     fi;
     yell "STATUS:Adding $repoURL as remote $remoteName";
     git remote add "$remoteName" "$repoURL";
     yell "STATUS:Pulling branch $branchName from remote $remoteName";
-    git pull "$remoteName" "$branchName";
+    git pull --ff-only "$remoteName" "$branchName";
     unset repoURL repoDir remoteName branchName;
     popd || exit 1;
     #==END create and populate git repository==
+    yell "================================";
 } # Init Git Repository
 #===END Declare local script functions===
 #==END Define script parameters==