Created
October 1, 2015 23:40
-
-
Save yusufhm/0ce70e1e4e3efac8be76 to your computer and use it in GitHub Desktop.
Add git remote if it does not exist
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/bash | |
$remote_name=$1 | |
$remote_url=$2 | |
git ls-remote --exit-code $remote_name &>/dev/null | |
if [ $? -ne 0 ]; then | |
git remote add $remote_name $remote_url | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment