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

Managing one github repo with Gitignore and Submodules for two different remotes

From
UUUSA Linux UAE <usasoftwareengineer@gmail.com>
Date
Feb 6, 2025, 14:10 UTC
Message-ID
<CAOXJ2J-StZYg4E9eGug=wHNjBu3aPdoy0x17aS9jLn14SyfJkA@mail.gmail.com>
Hi everyone,

I'm hoping to get some advice on managing a GitHub repository with a slightly complex setup. We have a main repo that utilizes both a .gitignore file and submodules. Our goal is to push this repo to two different remote repositories (let's call them remote_A and remote_B), but with a key difference:

remote_A should respect the .gitignore file as usual, excluding the files and directories specified within it. remote_B should effectively ignore the .gitignore file, and include all files and directories, even those listed in .gitignore. Essentially, we want the opposite behavior of .gitignore for remote_B.

Additionally, we need to ensure the submodules are handled correctly for both remotes. Ideally, the submodule pointers should remain consistent, regardless of which remote we're pushing to.

Could anyone offer advice on the best approach for this scenario? Are there any recommended workflows or tools specifically designed for this type of setup? Any insights regarding submodule management in this context would be greatly appreciated.

Thanks in advance for your help!
Amjad
Next: brian m. carlson
Message 1 of 2 in “Managing one github repo with Gitignore and Submodules for two different remotes”
  1. USA Linux UAEFeb 6, 2025
  2. brian m. carlsonFeb 6, 2025

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.