From 044df1cff6928073ab94faafa9bff0c7aa43e709 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 8 Jun 2023 21:24:06 -0500 Subject: Use current branch for push -u --- git-init-remote | 7 ++++--- 1 file 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" echo "git remote add origin \"$GITREMOTE:$remote\"" git remote add origin "$GITREMOTE:$remote" -echo -n "Push to remote?" +echo -n "Push to remote? " read case "$REPLY" in y*|Y*|'') - echo git push -u origin main - git push -u origin main + branch="$(git branch --show-current)" + echo git push -u origin "$branch" + git push -u origin "$branch" ;; *) ;; esac -- cgit 1.4.1-21-gabe81