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
directoryContainingAllRepos="" # directory containing all git repo's | |
oldGitRemoteServer="" # current remote server url for example gitlab.com | |
newGitRemoteServer="" # new remote server url for example git.example.com | |
cd $directoryContainingAllRepos | |
find * -maxdepth 0 -type d \( ! -name . \) -print | while read dir | |
do | |
cd $dir | |
if [ -d ".git" ] | |
then | |
remoteUrl1="$(git config --get remote.origin.url)" |