Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share files across git repositories?

Tags:

git

I have several applications across sub domains on various servers Each application has its own git repository. Each application uses several shared files. Essentially, my repos overlap. How is this situation best handled with multiple editors of multiple projects?

like image 378
tbeseda Avatar asked Oct 08 '09 22:10

tbeseda


People also ask

How do I share code between git repositories?

By using git submodules , you can have an independent repository inside a parent repository. So you have your web and mobile repository and then inside it, in a folder, the shared code repository. If you cd into the shared code folder, you can pull, commit, make branches and push back to the shared code.

How do I move files between GitHub repositories?

Merge the files into the new repository B. Step 2: Go to that directory. Step 3: Create a remote connection to repository A as a branch in repository B. Step 4: Pull files and history from this branch (containing only the directory you want to move) into repository B.


1 Answers

I would try making all the overlapping parts git submodules.

like image 161
mckeed Avatar answered Oct 11 '22 18:10

mckeed