外观
GitHub设置
171字小于1分钟
2024-12-20
github ssh 设置
Windows
C:\Users\mayna\.ssh\config
Host github.com
HostName ssh.github.com
Port 443
User git
TCPKeepAlive yes
ProxyCommand "C:\Program Files\Git\mingw64\bin\connect.exe" -H 127.0.0.1:10809 -a none %h %p
IdentityFile C:\Users\mayna/.ssh/github
C:\Users\mayna\.gitconfig
[http]
proxy = http://127.0.0.1:10809
[https]
proxy = http://127.0.0.1:10809
[user]
name = maynard
email = [email protected]
Linux
/home/maynard/.ssh/config
Host github.com
Hostname ssh.github.com
Port 443
User git
TCPKeepAlive yes
ProxyCommand nc -v -x 127.0.0.1:10808 %h %p
IdentityFile /home/maynard/.ssh/github
/home/maynard/.gitconfig
[http]
proxy = http://127.0.0.1:10808
[https]
proxy = http://127.0.0.1:10808
[user]
name = maynard
email = [email protected]
部署环境
部署机
git init --bare xxx.git
开发机
Host prod
HostName 172.1.1.1
Port 22
User maynard
IdentityFile C:\Users\mayna/.ssh/prod
git remote remove deploy
git remote add deploy prod:/home/maynard/xxx.git
git remote -v
git push deploy dev
部署机
git clone ~/xxx.git ~/xxx-prod
cd ~/xxx-prod
git checkout -b prod origin/dev