Updating repo origin when renaming organisation (if you have no repos with organisation name inside repo name)
git remote set-url origin `git config --get remote.origin.url | sed -e 's/OLD_ORG_NAME/NEW_ORG_NAME/g'`
The example above will have unintended bahavior if repo have organisation name inside repo name
e.g. you organisation is called bullshit
and repo is called bullshit-backend
- example above will rename both organisation and repository.
If you want to keep repo name unchanged check next example:
git config --get remote.origin.url | sed -e 's/github.com\/OLD_ORG_NAME/github.com\/NEW_ORG_NAME/g'