I have a directory which contains over 20 git repositories. I have to change the remote origin url in each of them. I don't want to do it manually and would like to use following command:
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && git remote set-url origin git@euxxx-x-x-xxx01.xx.xx.xxx.com:/foo/bar/'{}'.git" \;
The problem is, that brackets {} are replaced by relative path, so I end up with following commands:
git remote set-url origin git@euxxx-x-x-xxx01.xx.xx.xxx.com:/foo/bar/./zaz/repo.git
but I need simply
git remote set-url origin git@euxxx-x-x-xxx01.xx.xx.xxx.com:/foo/bar/repo.git
How to achieve this?