Подтвердить что ты не робот

Автоматически пропускать пустые коммиты при использовании git rebase

Обычно вам нужно сделать git rebase --skip, было бы неплохо, если бы был автоматический переход к этим пустым коммитам. Кто-нибудь знает, как это сделать?

4b9b3361

Ответ 1

G2 - использует следующий псевдоним continue

Url to 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
}