简体   繁体   English

git-svn rebase和dcommit问题

[英]git-svn rebase and dcommit problem

git version 1.7.1
svn, version 1.6.12
Ubuntu 10.10

I have just git and I have used svn. 我只是git而且我使用过svn。 But I haven't used then together. 但我没有一起使用过。 I had a git repository, and I had to more my repository to a subversion one. 我有一个git存储库,我不得不将我的存储库更多地转换为subversion版本。 So I have been using git-svn. 所以我一直在使用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:

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. 然后我检查我的play_video分支。 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, 非常感谢任何建议,

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? ". 意味着你最终处于DETACHED HEAD模式,你在git svn上下文中看到“ 我可以使用本地跟踪git-svn分支恢复SVN存储库中的丢失提交吗? ”。
See also " Why did git detach my head? ". 另见“ 为什么git脱离我的头? ”。

So make sure: 所以请确保:

  • at each step you are not in a detached HEAD (no branch) 在每一步你不是一个独立的HEAD(没有分支)
  • that you dcommit a branch which exists in your SVN repo (and not a pure local Git branch) dcommit了SVN dcommit中存在的分支(而不是纯粹的本地Git分支)

Did you use the Google instructions here to import your git repo to svn? 您是否使用此处的Google说明将git repo导入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. 我只是通过git svn init解决它 - 一个新的git repo来跟踪我的svn repo。

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. 我遇到了类似的问题,可能是因为我在推送到SVN遥控器之前推到了我的git遥控器,因此搞砸了我的git历史。 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. 好像每次我尝试向svn提交一些东西时,git会尝试重放我以前的所有提交,即使它们已经存在于svn中,所以我只是执行git rebase --skip直到我回到最新提交,但最简单解决方案可能只是克隆一个新的git svn。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM