git/list[1] front-page[2] threads[3] people[4] search[5] about
 

What to do if the path of my git submodules change upstream

From
HHHarald Heigl <harald@heigl-online.at>
Date
Nov 16, 2011, 14:37 UTC
Message-ID
<000301cca46d$5428c3d0$fc7a4b70$@heigl-online.at>
Hi everyone!
First setup of my git was a server (with ssh) and some clients.

Today I changed to gitolite because I wanted a more sophisticated way of managing my repos. So far so good… So the old path “ssh://[ip]/[fullpath].git” would change to a new path “git@[servername]:[gitreponame]”. This is no problem for “normal” repos, I change the remote origin and continue using push and pull.

I have some submodules: I changed the .gitmodules to reflect my changes, did a git submodule sync. This works flawlessly too!

But what if someone wants to checkout an older version of the project? (for comparison, or because he/she wanted to try something out) He would get an old .gitmodules with old paths. After a git submodule sync he would get errors, because old paths won’t work anymore, because I changed some paths on the server

It is only one project I have this problem and therein I changed the .gitmodules only 3 times. Is it possible to rewrite .gitmodules on these specific  commits on the server (perhaps with git-filter-branch)? Or is there another easy solution? Has someone ever had this problem?

Hope you can help, Kind regards, Harald Heigl

Message 1 of 1 in “What to do if the path of my git submodules change upstream”
  1. Harald HeiglNov 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.