Maintain multiple local repositories with different content pushed to the same GitHub repo? #45315
-
Select Topic AreaQuestion BodyThis is my data/ local repository situation:
During development I have two (2) local sources I want to watch with git and push to GitHub, so the combination of both local repositories defines the complete pushed repository. Note: Once a program is final there is no need to push from the final local repository. In case changes are needed the development cycle will re-start and I will have 2 local repositories again. My questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Without merging (or rebasing to similar effect) that's a no. If you want them in one repository and on the same branch you need a merged history. Merging would be exactly the Git way of dealing with this situation. Create as many clones of the repository you want (for example one per language), work on them on a branch each, once one of those is ready merge it. If you only want to avoid merge commits you can rebase instead of merging, but you need a combined history. You can use sparse checkout to put only certain files/directories into the working tree of a local repository, but:
|
Beta Was this translation helpful? Give feedback.
Without merging (or rebasing to similar effect) that's a no. If you want them in one repository and on the same branch you need a merged history.
Merging would be exactly the Git way of dealing with this situation. Create as many clones of the repository you want (for example one per language), work on them on a branch each, once one of those is ready merge it. If you only want to avoid merge commits you can rebase instead of merging, but you need a combined history.
You can use sparse checkout to put only certain files/directories into the working tree of a local repository, but: