0

I read about the possibility to integrate external git repositories with submodules:

# file .gitmodules
[submodule "other"]
    path = other
    url = git@github.com:foobar/other.git

I want to do this vice versa. There is a git versioned open source project which I cloned locally. I want to work on this project, maybe make some commits and pull requests there.

First I want to develop an own module for that system and therefore I need to create an new folder within the project. For my own code I want to use git too.

To develop fast and see my changes immediately on my local dev machine I don't want to split their git repo and mine but use both parallel. So I can't change their .gitignore or .gitmodules with my stuff.

How can I integrate my git submodule without touching files of the main project?

Sven R.
  • 1,049
  • 17
  • 24

1 Answers1

0

You can ignore the directory that your module uses using the .git/info/exclude file, which uses the same syntax as .gitignore. See this answer for more details on how it works.

You can't use git submodules, as they are specifically designed to keep one project in sync with the other one (if you make a commit in the submodule, you have to make a corresponding commit in the main git repository or the changes show up as untracked).

Community
  • 1
  • 1
Jack Taylor
  • 5,588
  • 19
  • 35