How do I move my local Git repository to a remote Git repository

后端 未结 8 1634

I have various Git projects that are on my local machine. I have a server that I would like to use as my remote Git Repository. How do I move my local Git Repositories (Pro

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 09:42

    On your server create the git repositories as bare repository

    git init --bare repo.git
    

    then, push the commits of your local repository

    git push --mirror ssh://yourserver/~/repo.git
    

提交回复
热议问题