Rebasing a git history with empty commit messages

前端 未结 6 1901
谎友^
谎友^ 2020-12-14 20:20

I recently converted an svn repository with git svn. Unfortunately the svn history has a number of empty commit messages. This is a problem when I rebase and

6条回答
  •  情书的邮戳
    2020-12-14 20:45

    To replace empty commit messages with some template, you can do something like this:

    git filter-branch -f --msg-filter '
    read msg
    if [ -n "$msg" ] ; then
        echo "$msg"
    else
        echo "The commit message was empty"
    fi'
    

提交回复
热议问题