{"thread":{"id":"40306","subject":"Bug report: Add submodule with --branch and --depth (git version 2.5.0.windows.1)","startedAt":"2015-09-09T07:45:28Z","lastAt":"2015-09-09T07:45:28Z","messageCount":1,"participants":["Anton Akhiar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"269637","messageId":"55EFE398.60208@gmail.com","threadId":"40306","inReplyTo":null,"subject":"Bug report: Add submodule with --branch and --depth (git version 2.5.0.windows.1)","fromName":"Anton Akhiar","fromEmail":"anton2k@gmail.com","sentAt":"2015-09-09T07:45:28Z","receivedAt":"2015-09-09T07:45:28Z","isPatch":false,"sender":{"key":"anton2k@gmail.com","avatar":null},"body":"Hi,\n\nI am trying to add a submodule with option --branch and --depth \ntogether, and failed. However, there is no problem if only one of them \nis applied.\n\nSo, this worked:\ngit submodule add --branch develop \nhttps://anton@bitbucket.org/anton/mysubmodule.git\n\nThis is also worked:\ngit submodule add --depth 1 \nhttps://anton@bitbucket.org/anton/mysubmodule.git\n\nBut this won't worked:\ngit submodule add --branch develop --depth 1 \nhttps://anton@bitbucket.org/anton/mysubmodule.git\n\n\nHere is how to replicate the problem:\n\nSetup remote repositories, e.g. in bitbucket:\nFor superproject: https://anton@bitbucket.org/anton/mysuperproject.git\nFor submodule: https://anton@bitbucket.org/anton/mysubmodule.git\n\nSetup local repository for superproject:\ngit init mysuperproject\ncd mysuperproject\necho \"This is the parent project\" > README\ngit add README\ngit commit -m \"add README\"\ngit remote add origin https://anton@bitbucket.org/anton/mysuperproject.git\ngit push --all -u origin\n\nSetup local repository for submodule with branch \"develop\":\ncd ..\ngit init mysubmodule\ncd mysubmodule\necho \"This is the submodule\" > README\ngit add README\ngit commit -m \"add README\"\ngit branch develop master\ngit remote add origin https://anton@bitbucket.org/anton/mysubmodule.git\ngit push --all -u origin\n\nNow, go to superproject and add submodule with options --branch and --depth:\ncd ../mysuperproject\ngit submodule add --branch develop --depth 1 \nhttps://anton@bitbucket.org/anton/mysubmodule.git mysubmodule\n\nOutput:\nCloning into 'mysubmodule'...\nPassword for 'https://anton@bitbucket.org':\nremote: Counting objects: 3, done.\nremote: Total 3 (delta 0), reused 0 (delta 0)\nUnpacking objects: 100% (3/3), done.\nChecking connectivity... done.\nfatal: Cannot update paths and switch to branch 'develop' at the same time.\nDid you intend to checkout 'origin/develop' which can not be resolved as \ncommit?\nUnable to checkout submodule 'mysubmodule'\n"}]}