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:

  • Cannot push to Heroku because key fingerprint
  • How do I discard unstaged changes in Git?
  • Unable to run git diff on a file that has moved
  • How to get git scm url for a Jenkins job with groovy
  • How to configure Araxis merge with Git Extensions
  • Why does git rebase --onto a b, git rebase --onto b a create a different SHA1 from the original?
  • 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.

  • git subtree fetch - unwanted remote tags
  • Deploying an MVC4 C# application to Azure via GitHub. What should be in my .gitignore?
  • git branching - how to make current master a branch and then revert master back to previous version?
  • fatal: unable to create 'refs/heads/master.lock': File exists fatal: - Getting this error while pushing the commits
  • Bitbucket teams/organizations?
  • What are some popular Git layout strategies?
  • 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.