Merge Two Git Repositories
Here is the step to merge two git repositories:
Let's say you have a project name X and another project name Y with same codebase but some different commit ahead/ behind of project X.
So you want to merge all the code from project-Y to project-X.
Let's assume you are already in the project-X.
git remote add project-Y path/to/project-Y
git fetch project-Y --tags
git merge --allow-unrelated-histories project-Y/master (note: Mention the branch name you want to merged with)
git remote remove project-Y
Thank you
Let's say you have a project name X and another project name Y with same codebase but some different commit ahead/ behind of project X.
So you want to merge all the code from project-Y to project-X.
Let's assume you are already in the project-X.
git remote add project-Y path/to/project-Y
git fetch project-Y --tags
git merge --allow-unrelated-histories project-Y/master (note: Mention the branch name you want to merged with)
git remote remove project-Y
Thank you
Comments
Post a Comment