- Published
- Author
- Sujay
Steps to merge one repo into another
Step 1: Clone Repo1 locally
Step 2: Fetch all the branches and commits from Repo2
Step 3: Create a branch
Step 4: Merge keeping full history
Step 5: Resolve Merge Conflicts
#git
Step 1: Clone Repo1 locally
Code
git clone repo1
cd repo1Step 2: Fetch all the branches and commits from Repo2
Code
git remote add repo2
git fetch repo2Step 3: Create a branch
Code
git checkout -b merge-repo2Step 4: Merge keeping full history
Code
git merge --allow-unrelated-histories repo2/main (Since the repositories have separate histories, this option allows Git to combine them, potentially requiring manual conflict resolution)Step 5: Resolve Merge Conflicts
Code
git add .
git commit -m "Resolved merge conflicts"#git