Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use same folder for multiple git repos?

Tags:

git

github

i have git repo like folloing

xyz
   abc
   def
      sample1.py
      sample2.py

i want to create separate git repo for "def" folder share it as another git repo and also want to use the same code as in my original git (xyz). like

def
   sample1.py
   sample2.py

it is like having two git repo for the same folder. so i will update in single place and push the files in two git repos.

i tried to use the submodule, but i dont want to change any properties of my current project. i don't want to create submodule in original git , i just want to export one of the folder as new git repo.

like image 559
Lava Sangeetham Avatar asked Jan 24 '26 19:01

Lava Sangeetham


1 Answers

Have you considered using git subtree. Here is link to a short tutorial of its usage: git subtrees: a tutorial Have a look and see if it is to your liking.

like image 122
Sebastian Stigler Avatar answered Jan 26 '26 08:01

Sebastian Stigler



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!