Skip to content

Instantly share code, notes, and snippets.

@munen
Created March 9, 2013 12:31
Show Gist options
  • Select an option

  • Save munen/5124033 to your computer and use it in GitHub Desktop.

Select an option

Save munen/5124033 to your computer and use it in GitHub Desktop.
Change github username from 'preek' to 'munen' in repository
echo "Showing old remote origin"
git remote -v
echo "--------"
NEW_REMOTE=$(git remote -v | head -n1 | awk '{print $2}' | sed -e 's/preek/munen/')
git remote set-url origin $NEW_REMOTE
if (( $? ));
then echo "failed to set new remote, please adjust manually";
else echo "succeeded in setting new remote";
fi
echo "--------"
echo "Showing new remote origin"
git remote -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment