summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2023-06-08 21:24:06 -0500
committerCase Duckworth2023-06-08 21:24:06 -0500
commit044df1cff6928073ab94faafa9bff0c7aa43e709 (patch)
treeb789f0d84c12f00dfadfa81e2ba6dfe75d10af2a
parentMake hook executable and prompt to push (diff)
downloadgit-init-remote-main.tar.gz
git-init-remote-main.zip
Use current branch for push -u main
-rwxr-xr-xgit-init-remote7
1 files changed, 4 insertions, 3 deletions
diff --git a/git-init-remote b/git-init-remote index 043a780..71b9dd4 100755 --- a/git-init-remote +++ b/git-init-remote
@@ -58,13 +58,14 @@ ssh "$GITREMOTE" chmod +x "$remote/hooks/post-update"
58echo "git remote add origin \"$GITREMOTE:$remote\"" 58echo "git remote add origin \"$GITREMOTE:$remote\""
59git remote add origin "$GITREMOTE:$remote" 59git remote add origin "$GITREMOTE:$remote"
60 60
61echo -n "Push to remote?" 61echo -n "Push to remote? "
62read 62read
63 63
64case "$REPLY" in 64case "$REPLY" in
65 y*|Y*|'') 65 y*|Y*|'')
66 echo git push -u origin main 66 branch="$(git branch --show-current)"
67 git push -u origin main 67 echo git push -u origin "$branch"
68 git push -u origin "$branch"
68 ;; 69 ;;
69 *) ;; 70 *) ;;
70esac 71esac