Merging Migraines
Recently, I had to migrate a client's code over to their own repository. At first we were concerned that we would lose our commit history, but I found that git has an easy-to-use solution for this. First, clone the old repository, and check out the branch you want to merge from. Next, clone the new repository, and checkout the branch you want to merge into. You may be surprised to learn that you can add your local clone of the old repository as a remote for your clone of the new repository, using the git add remote <old repository name> <old repository location> command. Follow that with the git remote update command, and now you'll be able to access the old branch using the git merge <old repository name/old branch name> command. Be sure to include the --allow-unrelated-histories flag so it allows your old commits.