Git Mailing List Archive mirror
 help / color / mirror / Atom feed
* Issue related to git submodules, tracking branches and custom remote names
@ 2024-04-25 13:00 Sergiu Todirascu
  0 siblings, 0 replies; only message in thread
From: Sergiu Todirascu @ 2024-04-25 13:00 UTC (permalink / raw)
  To: git@vger.kernel.org

Hi, 
I think there's an unexpected behaviour related to git submodules, tracking branches and custom remote names.

What did you do before the bug happened? (Steps to reproduce your issue)

1. Inside any git repo add a submodule via `git submodule add -b <branch> <repo-url>`
2. git submodule update --init
3. cd <submodule-repo> && git remote rename origin internal
3. git submodule update --remote

What did you expect to happen? (Expected behavior)

Command should be successful with: `Submodule path '<submodule>': checked out 'commit-hash'`

What happened instead? (Actual behavior)

`fatal: Unable to find refs/remotes/origin/branch revision in submodule path '<submodule>'`

What's different between what you expected and what actually happened?

As you can see in the error message, it's looking for the branch in the `origin` remote, which was renamed to `internal`.

Anything else you want to add:

I'd expect for git to either properly detect the changed remote or be able to specify it somewhere. I've looked into the https://git-scm.com/docs/gitmodules reference and couldn't find a setting for setting a custom remote there.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.39.3 (Apple Git-145)
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64
compiler info: clang: 15.0.0 (clang-1500.1.0.2.5)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh


[Enabled Hooks]
commit-msg
post-commit
pre-merge-commit

Thanks for looking into it,
Sergiu


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-25 13:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-25 13:00 Issue related to git submodules, tracking branches and custom remote names Sergiu Todirascu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).