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:

  • BitBucket: how to track a repo's branches in its Wiki repo?
  • In Git, local branches can track one another - how is this useful?
  • How to get the latest tag name in current branch in Git?
  • git ls-files in bare repository
  • Moving from TFSVC to GIT - Repository with partial History?
  • mysqldump schema only, schema update without drop
  • 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.

  • How to link already existing TFS-git commit to TFS work item?
  • Git; code disappeared after merge
  • Is it possible in git to just push 4 out of 5 commits?
  • Which version control system or platform is the best one for tracking and distributing personal Emacs configurations?
  • curious: where does git store user information?
  • How to ignore a file on Github when doing a git pull
  • 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.