Git常用笔记

  • 使用指定位置私钥 修改 ~/.ssh/config
1
2
3
4
5
Host github.com
    HostName github.com
    User git
    IdentityFile /home/lsk/.ssh/id_ed25519
    IdentitiesOnly yes

or you can try this:

GIT_SSH_COMMAND=“ssh -i ~/.ssh/id_ed25519” git clone git@github.com:trias-lab/tmware.git

  • 同步最新代码,不覆盖本地修改

1、先将本地代码放到暂存区

​​git stash​​

2、将远程github(码云等)上面的代码拉取下来

​​git pull​​

3、将第一步暂存区的代码放回本地

​​git stash pop​​

Licensed under CC BY-NC-SA 4.0
Built with Hugo
主题 StackJimmy 设计