Skip to content

Fix Git error during project configuration - #2971

Merged
liamcottle merged 1 commit into
meshcore-dev:devfrom
YoshiWalsh:fix/projectconfigurationgit
Sep 9, 2026
Merged

Fix Git error during project configuration#2971
liamcottle merged 1 commit into
meshcore-dev:devfrom
YoshiWalsh:fix/projectconfigurationgit

Conversation

@YoshiWalsh

Copy link
Copy Markdown

Previously project configuration would fail with "fatal: couldn't find remote ref d541301" (git v2.55.0)

This affected almost all platformio commands too. E.g.

 *  Executing task: platformio run --environment RAK_3401_repeater 

Processing RAK_3401_repeater (board: rak3401; platform: nordicnrf52; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Tool Manager: Installing git+https://github.com/meshcore-dev/Adafruit_nRF52_Arduino#d541301
git version 2.55.0
hint: Using 'master' as the name for the initial branch. This default branch name
hint: will change to "main" in Git 3.0. To configure the initial branch name
hint: to use in all of your new repositories, which will suppress this warning,
hint: call:
hint:
hint:   git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint:   git branch -m <name>
hint:
hint: Disable this message with "git config set advice.defaultBranchName false"
Initialized empty Git repository in /root/.platformio/.cache/tmp/pkg-installing-wokqua5c/.git/
fatal: couldn't find remote ref d541301
VCSBaseException: VCS: Could not process command ['git', 'fetch', '--depth=1', 'origin', 'd541301']

Per https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt-refspec, the argument needs to be either a ref (read: branch or tag) or a "fully spelled hex object name". The error appears to have been caused by the partial hex.

This requirement is also mentioned in this SO answer: https://stackoverflow.com/a/30701724

After this change, project configuration now succeeds.

@liamcottle

Copy link
Copy Markdown
Member

Please rebase onto dev branch.

@YoshiWalsh
YoshiWalsh changed the base branch from main to dev September 9, 2026 04:11
@YoshiWalsh

Copy link
Copy Markdown
Author

Done :)

@liamcottle

Copy link
Copy Markdown
Member

Can you rebase your local branch and force push please. Otherwise it pulls in those main branch changes.

If you create your local branch from dev instead of main, it doesn't pull those in :)

Previously project configuration would fail with "fatal: couldn't find remote ref d541301" (git v2.55.0)

Per https://git-scm.com/docs/git-fetch#Documentation/git-fetch.txt-refspec, the <src> needs to be either a ref or a "**fully spelled** hex object name"

This requirement is also mentioned in this SO answer: https://stackoverflow.com/a/30701724

After this change, project configuration now succeeds.
219812
@YoshiWalsh
YoshiWalsh force-pushed the fix/projectconfigurationgit branch from a8af634 to 82ea992 Compare September 9, 2026 07:42
@YoshiWalsh

Copy link
Copy Markdown
Author

Oh I didn't realise there were commits reachable from main that aren't reachable from dev. Should be fixed now.

@liamcottle

Copy link
Copy Markdown
Member

Oh I didn't realise there were commits reachable from main that aren't reachable from dev. Should be fixed now.

Yeah, it's mostly just documentation that gets opened against main, since the website etc builds from main branch. But all firmware/code related changes should be branched from dev and PR opened against dev.

Thanks for the fix :) Seems that this issue only affects some build environments, as it works fine on my end. But merging as I have seen the same issue for another dependency in the past.

@liamcottle
liamcottle merged commit 017fd09 into meshcore-dev:dev Sep 9, 2026
14 of 15 checks passed
@YoshiWalsh

Copy link
Copy Markdown
Author

My hunch is that it's probably related to which version of Git you have installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants