Git commit to common submodule (master branch)

前端 未结 6 1621
南方客
南方客 2020-12-02 04:56

I\'ve two or more projects (let\'s call them ProjectFoo and ProjectBar) having some common code that I put in a submodule

6条回答
  •  攒了一身酷
    2020-12-02 05:53

    Notice:

    git submodule foreach 'git commit -a'
    

    will fail if one of the submodules containt no commit to do.

    To get rid of this, you have to force the command result to 0.

    git submodule foreach "git commit -am 'your comment' || echo ' '"
    

    By using the echo piped you force the whole command to return with 0 and continue executing the commit command on the other submodules

提交回复
热议问题