diff options
Diffstat (limited to 'mac/.local/bin/gitupdate')
| -rwxr-xr-x | mac/.local/bin/gitupdate | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mac/.local/bin/gitupdate b/mac/.local/bin/gitupdate index bbe1a92..692a365 100755 --- a/mac/.local/bin/gitupdate +++ b/mac/.local/bin/gitupdate @@ -76,7 +76,12 @@ else # Add and commit changes git add --all . git commit -m "$message" - git pull --rebase origin "$branch" + if git remote | grep -qx origin; then + remote=origin + else + remote=$(git remote | head -n 1) + fi + git pull --rebase "$remote" "$branch" git remote | xargs -L1 git push --all fi |
