Created
July 14, 2023 05:25
-
-
Save ThaiDat/8c7fb23a4822e97cb1f527e289e5efbf to your computer and use it in GitHub Desktop.
Git extension to publish a new local branch to remote
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: pushes current checkout branch to remote | |
# Ex: git publish origin | |
if [ -z ${1+x} ] && [ $(git remote | wc -l) -eq 1 ]; then | |
remote=$(git remote) | |
else | |
remote=$1 | |
fi | |
git push --set-upstream $remote $(git branch --show-current) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment