git-svn rebase 和 dcommit 问题

发布于 2024-10-07 19:43:43 字数 1965 浏览 4 评论 0原文

git version 1.7.1
svn, version 1.6.12
Ubuntu 10.10

我只有 git,我用过 svn。不过我没一起用过。我有一个 git 存储库,我必须将我的存储库升级为 subversion 存储库。所以我一直在使用git-svn。大多数时候都可以正常工作。然而,我发现自己在兜圈子。

我是唯一一个从事这个项目的人。

我对我的分支做了一些更改。然后我将它们暂存:

git stage gateway.c

然后将它们本地提交到 git:

git commit m"Made some changes"

然后我想将它们提交到 subversion。获取最新更新:

git svn rebase

然后我收到以下消息:

It seems that I cannot create a rebase-apply directory, and
I wonder if you are in the middle of patch application or another
rebase.  If that is not the case, please
        rm -fr /home/joe/projects/gateway/.git/rebase-apply
and run me again.  I am stopping in case you still have something
valuable there.
rebase refs/remotes/trunk: command returned error: 1

I then doing the following:
rm -fr /home/joe/projects/gateway/.git/rebase-apply

然后我再次进行变基:

git svn rebase

消息是这样的:

First, rewinding head to replay your work on top of it...
Applying: Issue with getting the port from the user context.
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging driver.c
Auto-merging gateway.c
CONFLICT (content): Merge conflict in gateway.c
Failed to merge in the changes.
Patch failed at 0001 Issue with getting the port from the user context.

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

rebase refs/remotes/trunk: command returned error: 1

这将我放在一个名为的分支上,这个分支是什么以及它的用途是什么?:

*(no branch)

然后我将冲突解决为那个分支。然后我检查我的 play_video 分支。我尝试再做一个:

svn git dcommit

结果我又兜圈子。

在我开始拔头发之前,有人可以给我一些建议吗?

非常感谢您的建议,

git version 1.7.1
svn, version 1.6.12
Ubuntu 10.10

I have just git and I have used svn. But I haven't used then together. I had a git repository, and I had to more my repository to a subversion one. So I have been using git-svn. Which works ok, most of the time. However, I find going round in circles.

I am the only one working on this project.

I make some changes to my branch. I then stage them:

git stage gateway.c

Then commit them locally to git:

git commit m"Made some changes"

Then I want to commit them to subversion. Get the latest updates:

git svn rebase

Then I get the following message:

It seems that I cannot create a rebase-apply directory, and
I wonder if you are in the middle of patch application or another
rebase.  If that is not the case, please
        rm -fr /home/joe/projects/gateway/.git/rebase-apply
and run me again.  I am stopping in case you still have something
valuable there.
rebase refs/remotes/trunk: command returned error: 1

I then doing the following:
rm -fr /home/joe/projects/gateway/.git/rebase-apply

Then I do a rebase again:

git svn rebase

The message is this:

First, rewinding head to replay your work on top of it...
Applying: Issue with getting the port from the user context.
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
Auto-merging driver.c
Auto-merging gateway.c
CONFLICT (content): Merge conflict in gateway.c
Failed to merge in the changes.
Patch failed at 0001 Issue with getting the port from the user context.

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

rebase refs/remotes/trunk: command returned error: 1

Which puts me on a branch called, and what is this branch and what is it for?:

*(no branch)

I then resolve the conflicts to that branch. I then checkout my play_video branch. I try to make a another:

svn git dcommit

And I end up going round in circles again.

Before I start pulling my hair out, can some offer me some advice,

Many thanks for any suggestions,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

丶视觉 2024-10-14 19:43:43

没有完整的答案,但似乎可以肯定的是:

*(no branch)

意味着您最终处于 DETACHED HEAD 模式,您可以在“我可以使用本地恢复 SVN 存储库中丢失的提交吗跟踪 git-svn 分支?”。
另请参阅“为什么 git 分离了我的头?”。

因此,请确保:

  • 在每一步中,您都没有处于分离的 HEAD(无分支)中
  • ,您dcommit SVN 存储库中存在的分支(而不是纯本地 Git 分支)

No a complete answer, but what seems certain is that:

*(no branch)

means you end up in a DETACHED HEAD mode which you see in a git svn context in "Can I recover lost commits in a SVN repository using a local tracking git-svn branch?".
See also "Why did git detach my head?".

So make sure:

  • at each step you are not in a detached HEAD (no branch)
  • that you dcommit a branch which exists in your SVN repo (and not a pure local Git branch)
留蓝 2024-10-14 19:43:43

您是否使用此处的 Google 说明将 git 存储库导入到 svn?使用这些说明后,我遇到了类似的错误:初始导入顺利,但在某处出现问题,我无法推送后续提交。

我只是通过 git svn init 解决了这个问题 - 使用一个新的 git 存储库来跟踪我的 svn 存储库。

Did you use the Google instructions here to import your git repo to svn? I had a similar error after using those instructions: the initial import went fine, but something went wrong somewhere down the line and I couldn't push subsequent commits.

I resolved it by just git svn init-ing a fresh git repo to track my svn repo.

你的笑 2024-10-14 19:43:43

解决冲突后,您需要在运行 git svn dcommit 之前运行 git rebase --Continue

After resolving your conflicts you need to run git rebase --continue before running git svn dcommit

话少心凉 2024-10-14 19:43:43

我遇到了类似的问题,可能是因为我在推送到 SVN 远程之前推送到了 git 远程,从而弄乱了我的 git 历史记录。似乎每次我尝试向 svn 提交某些内容时,git 都会尝试重播我以前的所有提交,即使它们已经存在于 svn 中,所以我只是执行 git rebase --skip 直到我回到最新的提交,但最简单的解决方案可能是克隆一个新的 git svn。

I'm running into a similar problem, likely because I pushed to my git remote before pushing to the SVN remote and thus messed up my git history. It seems like each time I try to commit something to svn, git tries to replay ALL my previous commits even though they already exist in svn, so I just do git rebase --skip until I get back to the latest commit, but the easiest solution is probably to just clone a fresh git svn.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文