git-svn: re-link git-svn cloned repo to svn

I have on my gitlab a git repo which was originally cloned using git svn clone https://svn.url.com/project/trunk. I used to dcommit to the svn as well as git push to the gitlab from my local copy. But now I have now lost the original local copy where I do the git-svn clone from.. I do git clone from my gitlab but now I lost the capability to fetch from the svn and dcommit again.. Is there any way I can restore it? I’ve never back up the .git/svn folder under the git directory… 🙁

  • merging to branches, doesn't matter which one you merge into?
  • Intellij Idea 9/10, what folders to check into (or not check into) source control?
  • Merge two branches to create new branch
  • `git add *` offers fatal error
  • git merge vs rebasing
  • Project vs Repository in GitHub
  • Which files generated from Ionic do I include in source control?
  • What's the difference between 'git fetch' and 'git fetch --all'
  • One Solution collect form web for “git-svn: re-link git-svn cloned repo to svn”

    It is easy.

    Open up your git config (under .git/config)

    and add the following to the end

    [svn-remote "svn"]
          url = https://svn.url.com/
          fetch = :refs/remotes/git-svn
    

    you can then git-fetch to relink all your git-svn revisions

    P.S: if it takes too long and/or your revisions are too many, you can directly move your refs/remotes/git-svn to the last known svn-revision before doing the git-fetch
    e.g:

    git update-ref refs/remotes/git-svn refs/heads/master

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