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.

When I type git pull it says:

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? In any case, git gives an error:

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:

$ 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? I want to be back at the fresh SVN HEAD version.

  • SVN hooks for Windows
  • svn and git versioning models difference
  • Git : Switching between commits
  • Eclipse sending wrong project to github
  • GitHub: Find out if a git commit is included in a release?
  • Forking a sub directory of a repository on GitHub and making it part of my own repo
  • gitlab 6.0 Lost Project After Upgrade
  • How to copy Rails app with existing git repository?
  • One Solution collect form web for “How to get the latest SVN HEAD in git-svn?”

    For updating instead of “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”.

    “git checkout” doesn’t perform any changes, it just changes your current branch. You may change your current branch back but using “git checkout your_previous_commit_or_branch”.

    “git checkout -b branchname” creates a new branch. To delete a branch use ” git branch -D branchname”.

    Git Baby is a git and github fan, let's start git clone.