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

后端 未结 8 1614

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:26

    First, create a git repo on your server

    git init --bare /path/to/repo
    

    Then add the remote repo to your local one (ssh:// or https://)

    git remote add origin ssh://server/path/to/repo
    

    And, push files/commits

    git push origin master
    

    And finally, push tags

    git push origin --tags
    

提交回复
热议问题