Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Sergiu Todirascu <>
To: "" <>
Subject: Issue related to git submodules, tracking branches and custom remote names
Date: Thu, 25 Apr 2024 13:00:52 +0000	[thread overview]
Message-ID: <> (raw)

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 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.
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh

[Enabled Hooks]

Thanks for looking into it,

                 reply	other threads:[~2024-04-25 13:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).