git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Git submodule add with branch and depth option

From
CCole <cole@opteqint.net>
Date
Sep 4, 2014, 15:21 UTC
Message-ID
<CACsf_wy51oUaFOKHbg9QUQibkM045FYXY9HpYM84H5tvJcbPYg@mail.gmail.com>
Hi,
I am trying to add a submodule using the following command:

$ git submodule add -b gcc-4_9-branch --depth 1 https://github.com/gcc-mirror/gcc.git src

As you can see, I am trying to clone a single commit from the 'gcc-4_9-branch' branch, and avoid downloading the entire history of that branch.

However, after downloading all the necessary files, it then errors out with the following output:

colem@xvm14:~/repos/gcc-4.9 [0] $ git submodule add -b gcc-4_9-branch --depth 1 https://github.com/gcc-mirror/gcc.git src Cloning into 'src'... remote: Counting objects: 90203, done. remote: Compressing objects: 100% (71667/71667), done. remote: Total 90203 (delta 27425), reused 62802 (delta 17053) Receiving objects: 100% (90203/90203), 111.82 MiB | 467.00 KiB/s, done. Resolving deltas: 100% (27425/27425), done. Checking connectivity... done. fatal: Cannot update paths and switch to branch 'gcc-4_9-branch' at the same time. Did you intend to checkout 'origin/gcc-4_9-branch' which can not be resolved as commit? Unable to checkout submodule 'src' colem@xvm14:~/repos/gcc-4.9 [0] $ git --version git version 2.1.0 colem@xvm14:~/repos/gcc-4.9 [0]

Does anyone have any suggestions to try resolve the problem? Any help would be appreciated.

Regards /Cole

Message 1 of 1 in “Git submodule add with branch and depth option”
  1. ColeSep 4, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.