Skip to content
Discussion options

You must be logged in to vote

Hello, I am not very familiar with Git, but I did manage to merge two and more repositories into one. (after a few unsuccessful attempts seeking help on the internet, I did manage to get assistance from here).

Here's what I did:
I wanted to merge repo-a into repo-b.
I opened repo-a with GitHub Desktop (cloned),
opened it in VSCode, and accessed the terminal in VSCode (bash).

$ git remote rm origin
$ git remote add origin url_to_repo-b
$ git fetch
$ git checkout main  # Adjust the branch name as needed
$ git pull origin main --allow-unrelated-histories

Now, all the files showed up in the same folder as repo-b.

$ git push origin main

I checked in GitHub Desktop if any changes were left to…

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@reuelrai
Comment options

@rnv812
Comment options

@andybeet
Comment options

@glory0fNothing
Comment options

Answer selected by dascrapy
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Repositories The core of version-controlled code storage other General topics and discussions that don't fit into other categories, but are related to GitHub
7 participants