On 27/03/18 22:24, Alexandre Viau wrote:

> === After the migration ===

> - You may point your git working directories to the new remote address
> with this oneliner:
>  ``git remote set-url origin g...@salsa.debian.org:go-team/$(git
> config --get remote.origin.url | tr "/" "\n" | tail -n 1)``


Today I am finally updating my local repos, but this script is not good
for me, as I usually call my debian remote "debian". So I used this
instead (to fix all the repos in one directory):

for i in */; do test -d $i/.git || continue; git --git-dir=$i/.git
config --get-regexp '^remote\.[^.]*\.url$' | while read key value; do
newval=$(echo $value | sed
's#.*/git/pkg-go/packages/\([^/]*\.git\)/\?$#g...@salsa.debian.org:go-team/packages/\1#');
test "$value" != "$newval" || continue ; remote=$(echo $key | sed
's/^remote\.\([^.]*\)\.url$/\1/'); git --git-dir=$i/.git remote set-url
$remote $newval;  done; done



-- 
Martín Ferrari (Tincho)

_______________________________________________
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Reply via email to