base

git status
git config --global core.autocrlf input 签出不转换,lf一致
git config --global core.autocrlf true push为lf,pull为crlf
git config --global core.quotepath false 中文文件名乱码
git config --list 配置项
git branch -a 查看分支
git reset --hard 版本退回
git checkout -b deployv2_k8s_1.10 origin/deployv2_k8s_1.10 切换分支
git push origin -d xxx 删除远程分支
git pull origin xxx 更新远程分支
git commit -m ""
git rm --cached xxx 删除已经add的文件

push code

git checkout -b hotfix
git branch --unset-upstream master
git branch --set-upstream-to=hotfix
git config --global user.email "xiongyungang@corp-ci.com"
git config --global user.name "xiongyungang"
git add xxx
git commit -m ""
git push [-f] origin hotfix

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

git push --set-upstream origin hotfix (2)

push file or empty

git init
git add .
[git rm --cached xxx]
git commit -m ""
git remote add origin xxx
git push -u origin master

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄