Last active
January 18, 2024 13:55
-
-
Save andrey-zakharov/b391c28870540a41bf84c71aa4d1de1a to your computer and use it in GitHub Desktop.
GIT custom SSH port issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols