Restoring a lost svn history for a git project
up vote
1
down vote
favorite
I have a project, that was migrated from SVN to git some time ago.
WELL. Not really migrated. The last SVN revision was copied into the initial git commit. So basically all SVN history was squashed into the first git commit.
Many commits have now been added to the git repository.
Is there a way to way to rebase the new git commits onto a properly converted git repo? So we have the full history again?
Edit:
I now have two git branches, one with all the old history (old
), another with all the new history (new
). There is no diff between the last commit of old
and the first commit of new
. How do I merge those histories into one?
git svn git-svn
add a comment |
up vote
1
down vote
favorite
I have a project, that was migrated from SVN to git some time ago.
WELL. Not really migrated. The last SVN revision was copied into the initial git commit. So basically all SVN history was squashed into the first git commit.
Many commits have now been added to the git repository.
Is there a way to way to rebase the new git commits onto a properly converted git repo? So we have the full history again?
Edit:
I now have two git branches, one with all the old history (old
), another with all the new history (new
). There is no diff between the last commit of old
and the first commit of new
. How do I merge those histories into one?
git svn git-svn
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a project, that was migrated from SVN to git some time ago.
WELL. Not really migrated. The last SVN revision was copied into the initial git commit. So basically all SVN history was squashed into the first git commit.
Many commits have now been added to the git repository.
Is there a way to way to rebase the new git commits onto a properly converted git repo? So we have the full history again?
Edit:
I now have two git branches, one with all the old history (old
), another with all the new history (new
). There is no diff between the last commit of old
and the first commit of new
. How do I merge those histories into one?
git svn git-svn
I have a project, that was migrated from SVN to git some time ago.
WELL. Not really migrated. The last SVN revision was copied into the initial git commit. So basically all SVN history was squashed into the first git commit.
Many commits have now been added to the git repository.
Is there a way to way to rebase the new git commits onto a properly converted git repo? So we have the full history again?
Edit:
I now have two git branches, one with all the old history (old
), another with all the new history (new
). There is no diff between the last commit of old
and the first commit of new
. How do I merge those histories into one?
git svn git-svn
git svn git-svn
edited 10 hours ago
asked yesterday
MaxNoe
7,66622429
7,66622429
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
With a little work, sure. First, migrate correctly the svn repo into a git repo. Then add the git repo that you created from svn before (bad-remote, from now on) as a remote. When you fetch from it, you will be able to see the remote branches from bad-remote. Then rebase (or cherry-pick, whavever you think will be fine) the work that you did on bad-remote on top of the new svn branches on this repo.
git rebase --onto svn-full-history svn-short-history-first-revision-id svn-short-with-git-only-commits
That should apply all the git-only changes onto the full svn branch.
I now have two git branches, one with all the old history, another with all the new history. There is no diff between the last commit ofold
and the first commit ofnew
. How do I merge those histories into one?
– MaxNoe
10 hours ago
I'm not sure I quite understood. If I'm not mistaken what you mean is that you have fetched the full history of the svn branch (only working on a single svn branch, right?).. which I would assume I meant to call new and then you can also see on this repo the git repository with the old sv branch plus a lot of work done on git and not on svn, which I would assume you would call old. You have compared the first revision of old (which is the last revision of the project taken from svn) with the last revision of new (which is the branch with the full story) and they are both the same
– eftshift0
9 hours ago
The next step would then be to ask git to put the git-only history of the old repo onto the new svn branch, right? I'll add the recipe on my original answer
– eftshift0
9 hours ago
This would work, if the new git history is just linear. However there are tons of merges and resolved conflicts git know wants to have resolved again
– MaxNoe
9 hours ago
You could try to replicate the merges with --rebase-merges or --preserve-merges.git help rebase
will provide you will all the gory details (including a full section on rebasing merges).
– eftshift0
9 hours ago
|
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
With a little work, sure. First, migrate correctly the svn repo into a git repo. Then add the git repo that you created from svn before (bad-remote, from now on) as a remote. When you fetch from it, you will be able to see the remote branches from bad-remote. Then rebase (or cherry-pick, whavever you think will be fine) the work that you did on bad-remote on top of the new svn branches on this repo.
git rebase --onto svn-full-history svn-short-history-first-revision-id svn-short-with-git-only-commits
That should apply all the git-only changes onto the full svn branch.
I now have two git branches, one with all the old history, another with all the new history. There is no diff between the last commit ofold
and the first commit ofnew
. How do I merge those histories into one?
– MaxNoe
10 hours ago
I'm not sure I quite understood. If I'm not mistaken what you mean is that you have fetched the full history of the svn branch (only working on a single svn branch, right?).. which I would assume I meant to call new and then you can also see on this repo the git repository with the old sv branch plus a lot of work done on git and not on svn, which I would assume you would call old. You have compared the first revision of old (which is the last revision of the project taken from svn) with the last revision of new (which is the branch with the full story) and they are both the same
– eftshift0
9 hours ago
The next step would then be to ask git to put the git-only history of the old repo onto the new svn branch, right? I'll add the recipe on my original answer
– eftshift0
9 hours ago
This would work, if the new git history is just linear. However there are tons of merges and resolved conflicts git know wants to have resolved again
– MaxNoe
9 hours ago
You could try to replicate the merges with --rebase-merges or --preserve-merges.git help rebase
will provide you will all the gory details (including a full section on rebasing merges).
– eftshift0
9 hours ago
|
show 1 more comment
up vote
1
down vote
With a little work, sure. First, migrate correctly the svn repo into a git repo. Then add the git repo that you created from svn before (bad-remote, from now on) as a remote. When you fetch from it, you will be able to see the remote branches from bad-remote. Then rebase (or cherry-pick, whavever you think will be fine) the work that you did on bad-remote on top of the new svn branches on this repo.
git rebase --onto svn-full-history svn-short-history-first-revision-id svn-short-with-git-only-commits
That should apply all the git-only changes onto the full svn branch.
I now have two git branches, one with all the old history, another with all the new history. There is no diff between the last commit ofold
and the first commit ofnew
. How do I merge those histories into one?
– MaxNoe
10 hours ago
I'm not sure I quite understood. If I'm not mistaken what you mean is that you have fetched the full history of the svn branch (only working on a single svn branch, right?).. which I would assume I meant to call new and then you can also see on this repo the git repository with the old sv branch plus a lot of work done on git and not on svn, which I would assume you would call old. You have compared the first revision of old (which is the last revision of the project taken from svn) with the last revision of new (which is the branch with the full story) and they are both the same
– eftshift0
9 hours ago
The next step would then be to ask git to put the git-only history of the old repo onto the new svn branch, right? I'll add the recipe on my original answer
– eftshift0
9 hours ago
This would work, if the new git history is just linear. However there are tons of merges and resolved conflicts git know wants to have resolved again
– MaxNoe
9 hours ago
You could try to replicate the merges with --rebase-merges or --preserve-merges.git help rebase
will provide you will all the gory details (including a full section on rebasing merges).
– eftshift0
9 hours ago
|
show 1 more comment
up vote
1
down vote
up vote
1
down vote
With a little work, sure. First, migrate correctly the svn repo into a git repo. Then add the git repo that you created from svn before (bad-remote, from now on) as a remote. When you fetch from it, you will be able to see the remote branches from bad-remote. Then rebase (or cherry-pick, whavever you think will be fine) the work that you did on bad-remote on top of the new svn branches on this repo.
git rebase --onto svn-full-history svn-short-history-first-revision-id svn-short-with-git-only-commits
That should apply all the git-only changes onto the full svn branch.
With a little work, sure. First, migrate correctly the svn repo into a git repo. Then add the git repo that you created from svn before (bad-remote, from now on) as a remote. When you fetch from it, you will be able to see the remote branches from bad-remote. Then rebase (or cherry-pick, whavever you think will be fine) the work that you did on bad-remote on top of the new svn branches on this repo.
git rebase --onto svn-full-history svn-short-history-first-revision-id svn-short-with-git-only-commits
That should apply all the git-only changes onto the full svn branch.
edited 9 hours ago
answered yesterday
eftshift0
4,019817
4,019817
I now have two git branches, one with all the old history, another with all the new history. There is no diff between the last commit ofold
and the first commit ofnew
. How do I merge those histories into one?
– MaxNoe
10 hours ago
I'm not sure I quite understood. If I'm not mistaken what you mean is that you have fetched the full history of the svn branch (only working on a single svn branch, right?).. which I would assume I meant to call new and then you can also see on this repo the git repository with the old sv branch plus a lot of work done on git and not on svn, which I would assume you would call old. You have compared the first revision of old (which is the last revision of the project taken from svn) with the last revision of new (which is the branch with the full story) and they are both the same
– eftshift0
9 hours ago
The next step would then be to ask git to put the git-only history of the old repo onto the new svn branch, right? I'll add the recipe on my original answer
– eftshift0
9 hours ago
This would work, if the new git history is just linear. However there are tons of merges and resolved conflicts git know wants to have resolved again
– MaxNoe
9 hours ago
You could try to replicate the merges with --rebase-merges or --preserve-merges.git help rebase
will provide you will all the gory details (including a full section on rebasing merges).
– eftshift0
9 hours ago
|
show 1 more comment
I now have two git branches, one with all the old history, another with all the new history. There is no diff between the last commit ofold
and the first commit ofnew
. How do I merge those histories into one?
– MaxNoe
10 hours ago
I'm not sure I quite understood. If I'm not mistaken what you mean is that you have fetched the full history of the svn branch (only working on a single svn branch, right?).. which I would assume I meant to call new and then you can also see on this repo the git repository with the old sv branch plus a lot of work done on git and not on svn, which I would assume you would call old. You have compared the first revision of old (which is the last revision of the project taken from svn) with the last revision of new (which is the branch with the full story) and they are both the same
– eftshift0
9 hours ago
The next step would then be to ask git to put the git-only history of the old repo onto the new svn branch, right? I'll add the recipe on my original answer
– eftshift0
9 hours ago
This would work, if the new git history is just linear. However there are tons of merges and resolved conflicts git know wants to have resolved again
– MaxNoe
9 hours ago
You could try to replicate the merges with --rebase-merges or --preserve-merges.git help rebase
will provide you will all the gory details (including a full section on rebasing merges).
– eftshift0
9 hours ago
I now have two git branches, one with all the old history, another with all the new history. There is no diff between the last commit of
old
and the first commit of new
. How do I merge those histories into one?– MaxNoe
10 hours ago
I now have two git branches, one with all the old history, another with all the new history. There is no diff between the last commit of
old
and the first commit of new
. How do I merge those histories into one?– MaxNoe
10 hours ago
I'm not sure I quite understood. If I'm not mistaken what you mean is that you have fetched the full history of the svn branch (only working on a single svn branch, right?).. which I would assume I meant to call new and then you can also see on this repo the git repository with the old sv branch plus a lot of work done on git and not on svn, which I would assume you would call old. You have compared the first revision of old (which is the last revision of the project taken from svn) with the last revision of new (which is the branch with the full story) and they are both the same
– eftshift0
9 hours ago
I'm not sure I quite understood. If I'm not mistaken what you mean is that you have fetched the full history of the svn branch (only working on a single svn branch, right?).. which I would assume I meant to call new and then you can also see on this repo the git repository with the old sv branch plus a lot of work done on git and not on svn, which I would assume you would call old. You have compared the first revision of old (which is the last revision of the project taken from svn) with the last revision of new (which is the branch with the full story) and they are both the same
– eftshift0
9 hours ago
The next step would then be to ask git to put the git-only history of the old repo onto the new svn branch, right? I'll add the recipe on my original answer
– eftshift0
9 hours ago
The next step would then be to ask git to put the git-only history of the old repo onto the new svn branch, right? I'll add the recipe on my original answer
– eftshift0
9 hours ago
This would work, if the new git history is just linear. However there are tons of merges and resolved conflicts git know wants to have resolved again
– MaxNoe
9 hours ago
This would work, if the new git history is just linear. However there are tons of merges and resolved conflicts git know wants to have resolved again
– MaxNoe
9 hours ago
You could try to replicate the merges with --rebase-merges or --preserve-merges.
git help rebase
will provide you will all the gory details (including a full section on rebasing merges).– eftshift0
9 hours ago
You could try to replicate the merges with --rebase-merges or --preserve-merges.
git help rebase
will provide you will all the gory details (including a full section on rebasing merges).– eftshift0
9 hours ago
|
show 1 more comment
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53265684%2frestoring-a-lost-svn-history-for-a-git-project%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password