Skip to content

Instantly share code, notes, and snippets.

@shashank-shekhar
Created March 20, 2024 17:14
Show Gist options
  • Save shashank-shekhar/634114b96208778ed9a763338b0ddc83 to your computer and use it in GitHub Desktop.
Save shashank-shekhar/634114b96208778ed9a763338b0ddc83 to your computer and use it in GitHub Desktop.
copy one repo into an existing repo with history
cd repo2
git checkout master
git remote add r1remote **url-of-repo1**
git fetch r1remote
git merge r1remote/master --allow-unrelated-histories
git remote rm r1remote
#https://stackoverflow.com/a/17373088
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment