X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=blobdiff_plain;f=setup.sh;fp=setup.sh;h=e18d62c0f95197712c9fe6eeb98e265b288fb523;hp=8bb651c8f83c50ebf0a4b621b072e730484b4d61;hb=b7ab75a41290728ec465f732d697f136186a4cef;hpb=55dee6c2ef0b12f154d4d4cb2be1a2df882bcf3d diff --git a/setup.sh b/setup.sh index 8bb651c..e18d62c 100755 --- a/setup.sh +++ b/setup.sh @@ -28,6 +28,11 @@ function git_remote_init_update() { echo "Adding remote '$2' to '$1'." git remote add -t master "$2" "$3/$1" git fetch "$2" > /dev/null + # Remove the remote if the fetch was unsuccessful. + if [ "$?" -ne "0" ]; then + git remote rm "$2" + fi + # Pushing to the remote pushes only the master branch in remotes named # the hostname of this machine. This makes it easy to see where # changes came from.