2012-06-20 90 views

回答

0

G2 - 使用下面的別名continue

URL以G2 - https://github.com/orefalo/g2 的cheatsheet - http://orefalo.github.com/g2/

#!/bin/bash 
# 
# This command is used to resume a conflict, either rebase or merge 
# it will smartly do a rebase --skip when necessary 

state=$("$GIT_EXE" g2brstatus) 

[[ $state = "rebase" ]] && { 

action="--continue" 
if git diff-index --quiet HEAD --; then 
    echo "The last commit brings no significant changes -- skipping" 
    action="--skip" 
fi 

"$GIT_EXE" rebase $action 2> /dev/null 

} 

[[ $state = "merge" ]] && { 
# Count the number of unmerged files 
count=$("$GIT_EXE" ls-files --unmerged | wc -l) 
[[ $count -ne 0 ]] && echo "I am afraid you still have unmerged files, please run <g mt> to resolv conflicts" ||"$GIT_EXE" commit 
} 
+0

這似乎是非常有幫助的,但我希望做一次之初,像「git rebase --skip-empty」,而不是停在每一個。我會嘗試這個,雖然如果沒有其他事情變成 – quinn

+0

我不知道任何關於rebase的標誌。記得你在衝突解決後跳過,git希望你知道你是否應該重新佈局或繼續。 g2通過爲您解決問題修復了這個問題。你可以改變腳本給你喜歡。 –