纯JSP+Servlet人事系统:员工异动审批与PDF生成实战
2026/10/18 12:52:35
由于之前没有和其他同学一起合作开发过项目,这次合作开发项目使用了git,今天这篇博客就带0基础小白来学一学git的使用
克隆代码分为两种情况:
1.远程主分支上有代码,这个时候直接拉取就好:
git clone 仓库链接2.远程主分支上没有代码,你想要拉取主分支下面的特定分支的代码:
git clone -b 特定分子名 仓库链接合并代码分为四步:
git checkout developgit pull origin developgit merge 要提交的分支名git push origin developgit branch backup-mergegit checkout backup-mergegit initgit add .git commit -m"首次提交初始化项目文件"我们在提交的时候也是有格式的,格式如下:
feat: A new feature (新功能); fix: A bug fix (bug 修复,注:需将 bug 号以及修改的详细内容写上); docs: Documentation only changes (文档更新,如 README); style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)(代码格式修改,不影响代码逻辑,注:不是 CSS 修改); refactor: A code change that neither fixes a bug nor adds a feature (代码重构,既不是新特性也不是修复 bug,如函数改了名称); perf: A code change that improves performance (优化相关,比如提升性能、体验); test: Adding missing or correcting existing tests (新增测试用例,或修改已有测试用例); chore: Changes to the build process or auxiliary tools and libraries such as documentation generation (改变构建流程,或者增加依赖库、工具等,如新增文档生成工具); revert: 回到上一个版本git branchgit checkout -b developgit push -u origin develop --forcegit branch -a8.切换到自己的分支上
git checkout 分支名看一万遍不如尝试一遍,快去试试吧,有的命令就是很容易忘记!!