Git 命令总结
配置git
打开 git bash 开始配置
配置用户名(提交时候会引用)
git config --global user.name "wlj"
配置邮箱
git config --global user.email "[email protected]"
让Git不要管Windows/Unix换行符转换的事
git config --global core.autocrlf false
避免git gui中的中文乱码
git config --global gui.encoding utf-8
避免git status显示的中文名乱码
git config --global core.quotepath off
windows区分大小写设置
git config --global core.ignorecase false
生成ssh
ssh-****** -t rsa -C "[email protected]"
一直按回车(Enter),不要输入任何密码之类,生成 ssh key pair
ssh-add ~/.ssh/id_rsa
如果出现 Could not open a connection to your authentiacation agent
说明执行成功了 ,已经添加了私匙。
cat ~/.ssh/id_rsa.pub
显示很长的公匙,请复制出来
将公匙加到码云上
这样既可使用SSH的方式对码云上的项目使用Git了。
克隆
git clone [email protected]:lian_jie/loveme.git
拉取
Git pull
添加文件
Git add ./
提交
Git commit -m "haha~ ha~ "
推送
Git push
看日志
git log
参考文章 :
https://blog.****.net/u010920327/article/details/78741947
https://www.jianshu.com/p/93318220cdce