Crackerman Crackerman - 26 days ago 8
Git Question

Merge two versions of the same git repo

I currently have two Git repos that were created from the same SVN repo at different moments in time. One of the Git repos is local to my box (in folder

temp
), the other one is a remote repo that I have cloned to a different folder on my box (
SS
). The local repo is the most current repo. How can I use Git to update the remote repo with just the deltas from when the remote repo was created until today's latest change?

Below is what I have tried

cd SS
git add remote temp ../temp
git fetch temp


Results:

warning: no common commits
remote: Counting objects: 77563, done.
remote: Compressing objects: 100% (25852/25852), done.
remote: Total 77563 (delta 42638), reused 75783 (delta 40858)
Receiving objects: 100% (77563/77563), 45.68 MiB | 1.23 MiB/s, done.
Resolving deltas: 100% (42638/42638), done.


I thought that I would need to do a rebase, so I typed

git rebase master


Results:

Current branch master is up to date.


Then I was confused, so I did a

git status


Results:

On branch master
Your branch is up-to-date with 'origin/master'
nothing to commit, working tree clean


If this had worked the way I thought it would, it should have had the deltas added to
temp
from the time
SS
was created until today.

Where did I go wrong?

Answer

The rebase command gives Current branch master is up to date. because you are still On branch master; you have fetched temp, but you haven't changed branches, so the rebase has no effect.

What you probably meant to do was:

git checkout -b temp temp/master
git rebase master

And after that:

git checkout master
git merge --ff-only temp
git svn dcommit
Comments