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


Comments

Popular posts from this blog

Top 5 AI Tools Every Developer Should Use to Boost Coding Efficiency

How To Generate Random Dates Between Two Date Range in SQL Server

Find the number of columns in a table