常用命令
git config --list
git init
git clone
git add .
git commit -m "desc"
git pull origin master
git push origin master
git status
git log
git branch
git checkout master
git branch dev
git checkout dev
git merage dev
常见流程
- 本地项目push到gitee
git init
git add .
git commit -m "add all"
git remote add origin git@gitee.com:wupeiliang/test.git
git pull origin master --allow-unrelated-histories
git push origin master
- 远程仓库
git clone git@gitee.com:wupeiliang/test.git
git add .
git commit -m "add file"
git push origin master
常见错误
- fatal: refusing to merge unrelated histories(无法进行git pull 操作)
原因:git 版本更新导致git pull无法合并本地与托管平台的项目
修改:最新的版本需要添加--allow-unrelated-histories
git pull origin master --allow-unrelated-histories
Commit message 的格式
feat:新功能(feature)
fix:修补bug
docs:文档(documentation)
style: 格式(不影响代码运行的变动)
refactor:重构(即不是新增功能,也不是修改bug的代码变动)
test:增加测试
chore:构建过程或辅助工具的变动
结束语
- 天生我才必有用
- 把所有平凡的事都做好