changeRemote
The snippet can be accessed without any authentication.
Authored by
Laurent Heirendt
Edited
#!/bin/sh
find * -maxdepth 0 -type d \( ! -name . \) -print | while read dir
do
# replace the remote
if test -f "$dir/.git/config"; then
cd $dir/.git;
sed -i '' 's/git-r3lab-server\.uni\.lu/gitlab\.lcsb\.uni\.lu/g' config;
cd ../..;
echo " + Remote changed in $dir.";
else
echo " - The directory $dir is not versioned."
fi
done
-
This is a oneliner but with no output on what it does, so be warned :)
find . -path "*/.git/*" -name "config" -type f # if you are sure you wan't to update all the listed file you can then run find . -path "*/.git/*" -name "config" -type f -exec sed -i '' 's/git-r3lab-server\.uni\.lu/gitlab\.lcsb\.uni\.lu/g' {} +;
Please register or sign in to comment