foundry: forge update - Unable to find revision in submodule path
Component
Forge
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
0.2.0
What command(s) is the bug in?
forge update
Operating System
macOS (Apple Silicon)
Describe the bug
Hi there!
I’ve just started using foundry as a replacement of the hardhat (I really love the foundry idea ❤️ ).
I’m following the documentation and I realized that I have a small issue with forge update.
Basically I installed openzeppelin contracts:
forge install openzeppelin/openzeppelin-contracts
and if I execute a command forge update then I get an error:
Error:
fatal: Unable to find refs/remotes/origin/v4.8.0 revision in submodule path 'lib/openzeppelin-contracts'
The git submodule status returns:
a24d813f6bd4ab40e07e8ba940dbbe9cca03f9cd lib/forge-std (v1.1.0-4-ga24d813)
49c0e4370d0cc50ea6090709e3835a3091e33ee2 lib/openzeppelin-contracts (v4.8.0)
Any idea what I’m doing wrong?
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 17 (3 by maintainers)
rn forge update just does
unclear what this error even means. I think this is somehow related to the git tag of the dependency but no idea honestly.
So not sure what to actually do on
forge updateI’m also encountering this issue, and can reproduce it in a brand new forge project by running:
The workaround as of right now seems to be removing and reinstalling my submodules.
@mattsse after more investigation, i think the issue is the
branchspecification in the.gitmodules. some comments:submodule set-branchonly adds the entry in.gitmodulesfile, no additional magic behind the scenes. the submodule still points to the same commit at which it was added. stackoverflowbranchentry accepts branch name only. tags and shas are not supported.