I've spent a few months working on a project. It broke, I started a new project and just transfered the files, but I would like to transfer just the commit history into the new repository/project? I am a little familiar with git. What command line codes would I need to only transfer the commit history?
答案 0 :(得分:2)
Basically you want to add a new remote, so in the old project you just need to add a new remote:
$ git remote add origin git@remote-path/project.git
then run:
$ git remote -v
and you should have two remotes.
If you have the error:
fatal: remote origin already exists.
just use other name for remote:
$ git remote add new-origin git@remote-path/project.git
答案 1 :(得分:1)
Figured it out. Simply:
Go to project directory
cd ProjectAcceptingCommitMessages
Add project with commit history to current repository
git remote add projectB /home/you/projectB
git fetch projectB
Then merge the two together, therefore giving you the commit history
git merge projectB/master