多人协作开发一个项目时,版本控制工具是少不了的,git是linux 内核开发时引入的一个优秀代码管理工具,利用它能很好使团队协作完成一个项目。为了规范团队的代码提交,也方便出版本时的release note,更为了出问题时方便代码回溯,所以大家统一用一个模板提交代码是必要的。Git中设置template非常简单,只需以下几步即可:
1、在根目录建立模板文件
如 xxx_template文件,其内容如下:
OverView:
BUG:
Description:
2、设置模板,命令如下
git config commit.template [模板文件名] //这个命令只能设置当前分支的提交模板
git config— —globalcommit.template [模板文件名] //这个命令能设置全局的提交模板,注意global前面是两杠
例如:git config commit.template xxx_template
git config --global commit.template xxx_template
3、设置文本编辑器,命令如下:
git config --globalcore.editor [编辑器名字]
例如:git config --globalcore.editor vi
4、编辑模板提交代码,命令如下
git commit
注意:a、git commit之前先要使用git add将没有入库的代码入库
b、可以使用git commit -a提交多个代码文件
5、在第四步之后,会以设置的编辑器打开模板文件,然后按照格式修改该文件,并保存
6、提交代码到远程分支
git push
分享到:
相关推荐
使用方式: 1、解压package.rar package.rar 2、进入package文件夹,右键打开git bash 3、执行 sh install.sh 进行...4、执行git init 命令,查看当前目录是否生成 .git/gitcommit 和 .git/hooks/commit-msg 验证
personal used template for git commit. including category/bug id...
git提交信息模板 git提交信息模板 git提交信息模板 git提交信息模板
idea commit 模板插件
git规范化使用的jar包,是可以自定义提交类型的那种,因为现在在idea上下载的这种插件提交类型是选择项,不能自定义
用于IntelliJ的Git提交模板插件该插件允许使用以下模板创建提交消息: (): <subject><BLANK><body><BLANK><footer>从角项目的贡献准则 。安装直接从IDE插件管理器安装(文件>设置>插件>浏览器存储库> Git提交...
04★Git入门★第一次提交_git_commit
git commit 提交时提交内容自定义模板设置模板路径git config --global commit.template /home/xxx/commit.templategit config --global commit.template=C:/Users/xxx/commit.template
一篇非常不错的关于提交GIT message的英文文章
Git Commit 规范格式于说明 git commit 的类别,只允许使下的标识feat: 新功能(feature)bug: 发现 bug,但没有修复doc
使用CLI prompt轻松编辑 git commit
欢迎来到git-commit-msg-linter :waving_hand: :eyes: 立即查看您的每条git commit消息 :rocket: 。 一个git“ commit-msg”挂钩,用于根据流行的来替换您的git commit消息。 作为一个挂钩,它将在每次提交时运行...
主要介绍了详解git commit --amend 用法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
最后提交日志 Node.js模块可获取最新的git commit信息-主要由CI / CD和构建阶段使用。谁在用 :star: :star: :star: :star: :star: :star: :star: :star: :star:用法 const LCL = require ( 'last-commit-log' ) ;...
从 git commit 消息管理更改日志 命令 有2个可执行命令: bin/控制台 gitlog:branch [path_to_repo] 显示 repo 的分支。 bin/控制台 gitlog:commit [path_to_repo] 显示或导出日志。 该命令支持以下参数: --...
:slot_machine: git-committerA node.js script to generate a git commit commit record.一个用来生成 git commit 提交记录的 node.js 脚本用来填满 github 绿色小方块(或者其他用途).BeforeAfter :sparkles: :...
git rebase -i HEAD~n,n条commit进行rebase 将需要修改的commit信息,将pick命令改为 r 命令;ESC 输入 :wq 回车 开始修改commit信息,修改完,ESC 输入 :wq 回车 打印出成功 git log oneline -n,查看n条log信息,...
VSCode git commit是一个VSCode扩展,用于创建带有表情符号和前缀的精美提交消息。 那是第一个版本:P 如何使用它 ? 使用ctrl+alt+enter (在Mac上为cmd+shift+enter )或click SouceControl中的图标 设定值 1....
maven git commit id plugin git-commit-id-plugin is a plugin quite similar to ...
不git commit当你drunk时