- git help
- 生成秘钥
ssh-keygen -t rsa -C "绑定的邮箱地址"
- git clone
git clone git@github.com:shensunbo/code.git
- git add
git add file1 file2 …
git add . 添加所有git status中untracked的文件
- git log
git log --author=shen --before=2022-10-19 --after=2022-10-17 --merges
–oneline --reverse
- git blame
- git diff
- 撤销
- 撤销add
- git reset HEAD
- 撤销本地commit,不修改代码
- git reset --soft 版本号
- 撤销本地commit并回退代码
- git reset --hard 版本号
- 撤销本地文件修改
- git checkout 文件名
- 暂存
git stash save “comment”
git stash pop
git stash apply stash@{1}
- 提交忽略指定行
忽略指定行 - 修改提交日志
git commit --amend
- ssh远程服务器调试
参考链接 vscode ssh
- sftp:config
{
"name": "shensunbo_linux",
"host": "192.168.63.128",
"protocol": "sftp",
"port": 22,
"username": "shensunbo",
"remotePath": "/home/shensunbo/shensunbo/code",
"password": "123456",
"uploadOnSave": false,
"useTempFile": false,
"openSsh": false
}
- SFTP:download project
- 恢复为服务器版本
git reset --hard origin/10034625_Zeekr_CS1E_Develop_V2.0