Skip to content

Maintain multiple local repositories with different content pushed to the same GitHub repo? #45315

Answered by airtower-luna
p-et asked this question in General
Discussion options

You must be logged in to vote

Can I combine two (2) local repositories using push into one GitHub repository? (No merging).

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:

  1. That's marke…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by p-et
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants