feat(user):Script to get gpg fingerprints from git dir
[BK-2020-03.git] / unitproc / bktemp-initGitRepo
index 3e4b5663c65314c2d72ba9cf588a9f4d91874c65..10cfe4025606d9cc6663bccea95d63d574ec77db 100644 (file)
@@ -31,7 +31,7 @@ initGitRepo() {
     #        arg2: repoDir
     #        arg3: remoteName
     #        arg4: branchName
-    # Version: 0.0.7
+    # Version: 0.0.9
     # 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
@@ -75,8 +75,10 @@ initGitRepo() {
     fi;
     yell "STATUS:Adding $repoURL as remote $remoteName";
     git remote add "$remoteName" "$repoURL";
+    git branch --set-upstream-to "$remoteName"/"$branchName" "$branchName";
     yell "STATUS:Pulling branch $branchName from remote $remoteName";
     git pull --ff-only "$remoteName" "$branchName";
+    git fetch "$remoteName";
     unset repoURL repoDir remoteName branchName;
     popd || exit 1;
     #==END create and populate git repository==