Skip to content

Instantly share code, notes, and snippets.

@andrey-zakharov
Last active January 18, 2024 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrey-zakharov/b391c28870540a41bf84c71aa4d1de1a to your computer and use it in GitHub Desktop.
Save andrey-zakharov/b391c28870540a41bf84c71aa4d1de1a to your computer and use it in GitHub Desktop.
GIT custom SSH port issue
# read git current origin url
# прочитать текущий адрес удаленного сервера git
git remote get-url origin
# write git current origin url
# записать новый адрес сервера "origin"
# git protocol not allows define custom PORT
# Протокол git не позволяет определить собственный ПОРТ
git remote set-url origin git@$URL-WITHOUT-PORT-ONLY:main/project1.git
# workaround #1: ssh aliases and use alias with port as URL with git:// proto
# workaround #2: ssh protocol does
git remote set-url origin ssh://$HOSTNAME:$PORT/main/project1.git
@andrey-zakharov
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment