Possible bug in Git submodule update --inti
- From
- bech <bech>
- Date
- Nov 18, 2024, 08:14 UTC
- Message-ID
- <DB9PR10MB709879A45AABEC017F3E89DF8A272@DB9PR10MB7098.EURPRD10.PROD.OUTLOOK.COM>
Hi
I am trying to replace a submodule of a repository with a rewritten version. Somebody added a huge json file without enabling lfs, so I cannot move the submodule to GitHub without the rewrite.
The path of the submodule is: ./Submodules/Lodam.Standard, which I have no intensions of changing.
The url of the original submodule is: https://lodamrd.visualstudio.com/Features.Net/_git/Lodam.Standard The url of the rewritten submodule is: https://lodamrd.visualstudio.com/Features.Net/_git/Uniware.Standard
I planned to do a: git submodule deinit -f <path-to-submodule> git submodule set-url -- <path-to-submodule> <new-url> git submodule update --init <path-to-submodule>
But actually the sources for the submodule is fetched from the original (same commit SHAs as before), whereas if I do:
git submodule deinit -f <path-to-submodule> git submodule set-url -- <path-to-submodule> <new-url> git clone <new-url> <path-to-submodule>
I get the submodule from the new url with the rewritten commit SHA’s.
I have attached the PowerShell output with trace information. I am unfamiliar with git trace, but from line 203 I can see the old url mentioned, where I would expect the new url.
Best regards
Søren Bech Christensen Software Engineer BITZER Electronics A/S PC Software Team Kærvej 75 6400 Sønderborg // Denmark Direct: +45 73 42 37 70 Phone: +45 73 42 37 37 Mobile: +45 25 44 49 65 Email: Soeren.Bech@bitzerdk.com