Calling all git wizards.
I have a local git instance with commits, branches, tags, merges all the good things.
Now I was given a git repository and all my code shall move into a directory, that exists inside that repository, so that leads to my question.
Can I move a git instance to a directory, that is tracked inside another instance, and push everything as if I had always done the development inside that directory?
Maybe I can do something like a submodule, but it is not supposed to remain a submodule.
In case it is important: the git repository is on gitlab.
Asked
Active
Viewed 26 times
0

bananabook
- 58
- 6
-
1What is a "git instance"? – matt Jul 28 '22 at 18:29
-
Oh, I mean a local git repositry. – bananabook Jul 29 '22 at 19:19
-
Well, obviously you can just move your files (as they appear in some commit) into a different repository. But then you lose your history; the files will simply appear as if by magic in the next commit you create and push. So if "as if I had always done the development inside that directory" means you want to bring the whole history with you, that's another matter; sounds like a duplicate of, say, https://stackoverflow.com/questions/1425892/how-do-you-merge-two-git-repositories – matt Jul 29 '22 at 19:59