Update a submodule to the latest commit

前端 未结 8 1070
北荒
北荒 2020-12-07 06:54

I have a project A which is a library and it is used in a project B.

Both projects A and B have a separate repository on github BUT inside B we have a submodule of A

相关标签:
8条回答
  • 2020-12-07 07:22

    None of the above answers worked for me.

    This was the solution, from the parent directory run:

    git submodule update --init;
    cd submodule-directory;
    git pull;
    cd ..;
    git add submodule-directory;
    

    now you can git commit and git push

    0 讨论(0)
  • 2020-12-07 07:24

    Andy's response worked for me by escaping $path:

    git submodule foreach "(git checkout master; git pull; cd ..; git add \$path; git commit -m 'Submodule Sync')"
    
    0 讨论(0)
提交回复
热议问题