{"thread":{"id":"24117","subject":"Submodule handling broken when changing branches?","startedAt":"2010-06-15T06:23:55Z","lastAt":"2010-06-15T06:23:55Z","messageCount":1,"participants":["Nico -telmich- Schottelius"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"143722","messageId":"20100615062355.GA3096@schottelius.org","threadId":"24117","inReplyTo":null,"subject":"Submodule handling broken when changing branches?","fromName":"Nico -telmich- Schottelius","fromEmail":"nico-linux-git@schottelius.org","sentAt":"2010-06-15T06:23:55Z","receivedAt":"2010-06-15T06:23:55Z","isPatch":false,"sender":{"key":"nico-linux-git@schottelius.org","avatar":null},"body":"Good morning devs,\n\nI'm wondering whether it is the intented behaviour that after\nadding a submodule one is unable to change branchen?\n\nSteps to reproduce\n\n   ( mkdir sm && cd sm && touch a && git init && git add . && git commit -m \"init\" )\n\n   ( mkdir -p project/smdir && cd project && touch smdir/a  && git init && git add . && git commit -m \"init\" && git branch second ) \n\n  ( cd project && git rm smdir/a &&  git commit -m \"remove file that will be replaced by sm\")\n  \n  ( cd project && git submodule add ~/temp/git/sm smdir && git submodule update --init && git commit -m \"add submodule\" )\n\n  ( cd project && git checkout second )\n  error: Untracked working tree file 'smdir/a' would be overwritten by merge.\n\nIt seems that the contents of a submodule are not cleanly moved away\nwhen switching branches, I also see that in other places where the directory\nis not known to the other branch, it will just stay.\n\nIf that is intented, what would be the clean way to switch the branch?\nIf so, shouldn't it be documented in the manpage?\n\nNico\n\n-- \nNew PGP key: 7ED9 F7D3 6B10 81D7 0EC5  5C09 D7DC C8E4 3187 7DF0\nPlease resign, if you signed 9885188C or 8D0E27A4.\n\nCurrently moving *.schottelius.org to http://www.nico.schottelius.org/ ...\n"}]}