[Git] git commit調用模板描述本次提交內容


git commit 的作用是簡要描述本次提交內容

 

如果描述沒有固定的要求,就可以使用簡單描述

git commit -m "描述"

 

如果對每次提交的描述有嚴格的要求,則可以調用模板來完成 commit

1、在固定路徑編輯好模板格式,例如:commit.txt

2、配置參數
設置模板路徑
git config --global commit.template ~/work/commit.txt
設置commit編輯工具
git config --global core.editor vim
設置用戶名
git config --global user.name "name"
設置用戶郵箱
git config --global user.email "Email"

3、上傳代碼
更新代碼
git add ***
git commit
git push


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM