Skip to content

Instantly share code, notes, and snippets.

@jefrnc
Created November 10, 2023 21:14
Show Gist options
  • Save jefrnc/91f71028b7992071463bee757f71334d to your computer and use it in GitHub Desktop.
Save jefrnc/91f71028b7992071463bee757f71334d to your computer and use it in GitHub Desktop.
Local Switch
origin_url=$(git config --get remote.origin.url)
if [[ $origin_url == *"AgTechHub"* ]]; then
new_url=${origin_url/AgTechHub/nera-agro}
git remote remove origin
git remote add origin $new_url
echo "El origen del repositorio se ha actualizado a $new_url"
else
echo "El repositorio actual no pertenece a la organización AgTechHub."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment