How to create a remote Git repository from a local one?

前端 未结 8 1742
不知归路
不知归路 2020-12-02 03:29

I have a local Git repository. I would like to make it available on a remote, ssh-enabled, server. How do I do this?

相关标签:
8条回答
  • 2020-12-02 04:27

    You need to create a directory on a remote server. Then use "git init" command to set it as a repository. This should be done for each new project you have (each new folder)

    Assuming you have already setup and used git using ssh keys, I wrote a small Python script, which when executed from a working directory will set up a remote and initialize the directory as a git repo. Of course, you will have to edit script (only once) to tell it server and Root path for all repositories.

    Check here - https://github.com/skbobade/ocgi

    0 讨论(0)
  • 2020-12-02 04:29

    I think you make a bare repository on the remote side, git init --bare, add the remote side as the push/pull tracker for your local repository (git remote add origin URL), and then locally you just say git push origin master. Now any other repository can pull from the remote repository.

    0 讨论(0)
提交回复
热议问题