Skip to content

Git

Git 提交规范

commit: {
		feat: 'feat:新功能',
		fix: 'fix:修复',
		docs: 'docs:文档变更',
		style: 'style:代码格式(不影响代码运行的变动)',
		refactor: 'refactor:重构(既不是增加feature,也不是修复bug)',
		perf: 'perf:性能优化',
		test: 'test:增加测试',
		chore: 'chore:构建过程或辅助工具的变动,依赖更新/脚手架配置修改等',
		revert: 'revert:回退',
		build: 'build:打包',
		workflow: 'workflow :工作流改进',
}

git 使用教程

克隆仓库git clone https://***.git

查看文件状态git status

暂存文件git add .

提交暂存的文件,添加描述git commit -m ""

推送代码到远程仓库git push

拉取远程仓库的代码git pull

新建并切换到该分支git checkout -b develop

新建分支git branch develop

切换分支git checkout develop

分支合并:切换到主分支,合并develop

切换到主分支git checkout master

合并git merge develop

查看分支git branch

切换分支git checkout develop

推送代码到远程仓库git push origin develop

查看远程分支git branch -r

拉取远程分支git branch pc origin/pc

远程仓库的所有分支拷贝到本地仓库git fetch