Archive

Archive for September, 2016

Git and submodule

September 7th, 2016 Comments off

Sometimes things get a little out of sync in your submodule folder, your ‘root’ project sometimes report something like

\ In the git branch
[branch = +0 ~1 -0 !]>

Or even  something along the lines of

\ In the submodule folder
[(7cd98ce...)]>

Showing that you are no longer on the correct branch, (for the submodule).

One one way to clean it all up is to do.

\ In the submodule folder
git checkout master
git pull
git push origin HEAD:master
git checkout master

Assuming that you have no other changes to commit

\ In the root folder
git clean -fd
git pull
git submodule update --init --recursive
git submodule update

And that should clear everything

Categories: Cheat-sheet, development Tags: