Git規範

weixin_33716557發表於2016-09-30

規範

  1. git的使用流程建議參考“Git使用規範流程”.[3]
  2. 建議
    a.在特性開發時,commit要以邏輯為單位,鼓勵小規模提交。但是,在確定要將特性分支合併到dev/master分支上時,建議對commit進行壓縮,壓縮的方法和原因參考[3]
    b.在開發過程中,如果某個功能開發時間特別久,建議定期merge主分支

參考

  1. Git分支管理策略
    http://www.ruanyifeng.com/blog/2012/07/git.html

  2. git中利用rebase來壓縮多次提交
    http://blog.csdn.net/itfootball/article/details/44154121

  3. Git 使用規範流程
    http://www.ruanyifeng.com/blog/2015/08/git-use-process.html

  4. A successful Git branching model
    http://nvie.com/posts/a-successful-git-branching-model/

Git常用命令縮寫

[user]                                                                                                                                                                                                       
    email = xxx@163.com
    name = xxx
[core]
    editor = vim 
[alias]
    save = !git add -A && git commit -m 'SAVEPOINT'
    undo = reset HEAD~1 --mixed
    wip = commit -am "WIP"
    amend = commit -a --amend
    wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
    ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
    ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
    ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
    lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
    la = "!git config -l | grep alias | cut -c 7-" 
    lasttag = describe --tags --abbrev=0
    lt = describe --tags --abbrev=0
    week = log --author=xxx --after='1 week ago' --oneline --decorate
    unmerge = log --no-merges master..

相關文章