git要知道的事

204 阅读1分钟

最常见的命令

git add . git commit -m "feat: 新功能" git push

如何移除某文件的版本控制

  • 没有git add

    .gitignore文件中添加

  • 已经git add

    git rm -r --cached 文件

    .gitignore中添加

git提交规范

7个单词

  • feat:新功能(feature)
  • fix:修补bug
  • docs:文档(documentation)
  • style: 格式(不影响代码运行的变动)
  • refactor:重构(即不是新增功能,也不是修改bug的代码变动)
  • test:增加测试
  • chore:构建过程或辅助工具的变动