简体   繁体   English

如何在git-svn中获取最新的SVN HEAD?

[英]How to get the latest SVN HEAD in git-svn?

I'm using git-svn and I'd like to update to the latest SVN HEAD. 我正在使用git-svn ,我想更新到最新的SVN HEAD。

When I type git pull it says: 当我输入git pull它说:

fatal: No remote repository specified.  Please, specify either a URL or a
remote name from which new revisions should be fetched.

I read here that I should do something like: 在这里读到,我应该做类似的事情:

git checkout -b real-trunk remotes/trunk

But I don't understand the command. 但是我不明白命令。 What's remote-trunk ? 什么是remote-trunk In any case, git gives an error: 无论如何, git都会给出一个错误:

fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'remotes/trunk' which can not be resolved as commit?

Here is my .git/config : 这是我的.git/config

$ cat .git/config 
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[svn-remote "svn"]
        url = http://name.xyz.com/svn/trunk/project
        fetch = :refs/remotes/git-svn

Also, can anyone tell me how to revert all changes that I made in my git checkout? 另外,有人可以告诉我如何还原我在git checkout中所做的所有更改吗? I want to be back at the fresh SVN HEAD version. 我想回到新的SVN HEAD版本。

For updating instead of "git pull": 用于更新而不是“ git pull”:

git svn rebase

I guess you already have refs/heads/master corresponding your refs/remotes/git-svn, so work with it, you need no "real-trunk". 我想您已经有refs / heads / master与您的refs / remotes / git-svn相对应,因此使用它,您不需要“真正的树干”。

"git checkout" doesn't perform any changes, it just changes your current branch. “ git checkout”不执行任何更改,仅更改您当前的分支。 You may change your current branch back but using "git checkout your_previous_commit_or_branch". 您可以改回当前分支,但可以使用“ git checkout your_previous_commit_or_branch”。

"git checkout -b branchname" creates a new branch. “ git checkout -b分支名称”创建一个新分支。 To delete a branch use " git branch -D branchname". 要删除分支,请使用“ git branch -D branchname”。

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

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