生成SSH Key
.ssh
的文件路径
C:\Users\###\.ssh\
ssh-keygen -t rsa -C "###@mail.com"
在.ssh
会生成 id_rsa
id_rsa.pub
需要把 id_rsa.pub
中的内容,复制到 git
服务器
查看git的配置信息
git config -l
设置用户信息
git config --global user.name "###" // 配置全局用户名
git config --global user.email "###" // 配置全局的邮件地址
设置别名
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.br branch
git config --global alias.d diff
git config --global alias.sh stash
git config --global alias.last 'log -1'
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
已经修改的未提交的文件,回退修改
git co -- "/文件路径"
添加tag
git tag //列出所有的tag
git tag -a v1.0 -m "####" //添加一个tag
git show v1.0 //显示tag
git tag -d v1.0 //删除tag
暂存
git stash // 暂存当前的修改
git stash pop //重新应用修改
git stash list //查看暂存
git stash drop //移除修改