How can I associate local unversioned code to git remote repository?

前端 未结 4 1002
别跟我提以往
别跟我提以往 2020-12-31 00:24

I need to associate a clean unversioned code to an existing git remote repository.

I explain better my situation. My project is moved from svn to git. I have a svn

4条回答
  •  甜味超标
    2020-12-31 01:08

    Ok, I post the right answer for my question based on Adam Dymitruk and Eugene Sajine answers. Thanks everyone for the support :)

    • First of all, remove all .svn directories in working copy directory;
    • initialize new git repository in the working copy directory

      cd /path/to/my/project
      git init
      
    • add git remote repository and fetch it

      git remote add origin url-to-your-remote
      git fetch origin
      
    • reset working copy to remote repository

      git reset --hard origin/master
      

    At the end local repository will be synchronized with remote repository.

提交回复
热议问题