34
loading...
This website collects cookies to deliver better user experience
tl;dr Alias for removing Git remote and adding it back
git config --global alias.readd '!f() { REMOTE=$(git config --get remote."$1".url); git remote remove "$1"; git remote add "$1" "$REMOTE"; }; f'
git readd remote-name
git remote -v
ion [email protected]:ion-golovco/catalog-profesii.git (fetch)
ion [email protected]:ion-golovco/catalog-profesii.git (push)
origin [email protected]:code4moldova/catalog-profesii.git (fetch)
origin [email protected]:code4moldova/catalog-profesii.git (push)
radu [email protected]:Raduc4/catalog-profesii.git (fetch)
radu [email protected]:Raduc4/catalog-profesii.git (push)
sergiu [email protected]:YoSoySergio/catalog-profesii.git (fetch)
sergiu [email protected]:YoSoySergio/catalog-profesii.git (push)
git remote -v
to list all remotesgit remote remove name-of-remote
git remote add name-of-remote PASTE_URL
git config --global alias.readd '!f() { REMOTE=$(git config --get remote."$1".url); git remote remove "$1"; git remote add "$1" "$REMOTE"; }; f'
git readd remote-name
git readd origin
git readd upstream
# ...
git config --global alias.alias-name 'log -1 HEAD'
!
character....
remaining content)git config --global alias.readd '!f() { ... }; f'
REMOTE=$(git config --get remote."$1".url);
git remote remove "$1";
git remote add "$1" "$REMOTE";
git config --get remote."$1".url
REMOTE
the result"$1"
"$1"
with url REMOTE
created before"$1"
represents the argument that was passed to aliasgit readd ion
git readd radu
git readd sergiu