|
For security or other reasons, we may modify the default SSH port services, by default, the existing project in git pull or push the time error.
Now suppose that the original set up remote project is git@linuxhost.com: Projects / p1.git, SSH server default port changes after 3022, leading to push error.
There are two solutions:
First, directly modify the URL to SSH: // at the beginning of
git remote set-url origin ssh: //git@linuxhost.com: 3022 / ~ / Projects / p1.git
Second, modify the local configuration files
cat> ~ / .ssh / config
# Mapping an alias
host newlinuxhost
hostname linuxhost.com
port 3022
# Ctrl + D
git profile under Modify p1.git project
git remote set-url origin git @ newlinuxhost: Projects / p1.git |
|
|
|