diff options
author | Jonas Smedegaard <dr@jones.dk> | 2017-04-21 23:43:37 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2017-04-21 23:43:37 +0200 |
commit | de99bc4db19f6056e7a7c644c21485a1ba22c622 (patch) | |
tree | 780d95c077a744a95ce512dae86b86f841bc9f02 | |
parent | 20d29799809f3e3bbf1824a0cd73c4a668e8c5cb (diff) |
Tolerate failiure initializing git (fails if done already but by different user and in subdir).
-rwxr-xr-x | localgit-remote-init-push | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/localgit-remote-init-push b/localgit-remote-init-push index 5d8efd5..c581bde 100755 --- a/localgit-remote-init-push +++ b/localgit-remote-init-push @@ -68,6 +68,7 @@ GIT_REMOTE=${4:-origin} [ origin != "$GIT_REMOTE" ] || ORIGIN_IS_DEFAULT=yes -[ -z "$SSH_CONN" ] || ssh "$SSH_CONN" git init --bare --shared "$BASEPATH"/"$PROJECT".git +# TODO: handle /~ BASEPATH specially and stop blindly ignore any error +[ -z "$SSH_CONN" ] || ssh "$SSH_CONN" git init --bare --shared "$BASEPATH"/"$PROJECT".git || true git remote add "$GIT_REMOTE" "$SSH_CONN":"$BASEPATH"/"$PROJECT".git git push ${ORIGIN_IS_DEFAULT:+--set-upstream} "$GIT_REMOTE" master |