Self-host remote git repository on Windows server

前端 未结 1 1048
孤独总比滥情好
孤独总比滥情好 2021-02-02 13:14

We have a computer on our local network designated as \'the server\', that runs Windows XP, where we keep the shared folders and stuff that should be visible to all.

How

相关标签:
1条回答
  • 2021-02-02 13:48

    Edit: I recently found about Bonobo Git Server - it is a free and open-source Git Server for Windows and IIS, licensed with an MIT license. I haven't tested it myself yet, but you can give it a try.

    There is also this CodeProject article - Step by Step Setup Git Server on Windows with CopSSH + msysGit and Integrate Git with Visual Studio


    Old answer: In the end, I did as @meagar suggested - I created a shared folder on the server, and I followed this tutorial, the part about using Git Gui. Note that we use pushd/popd because CD does not support UNC paths:

    pushd \\remote-pc\SharedDocs\MyRemoteGitRepo1
    git init --bare
    popd
    

    Now all you need to do is connect your local repo to remote one. Note that you need to use forward slashes for git remote add origin, or it won't work:

    cd C:\Workspace\MyLocalGitRepo1
    git remote add origin //remote-pc/SharedDocs/MyRemoteGitRepo1
    

    And finally you can push your work to the remote repo:

    git push origin master
    
    0 讨论(0)
提交回复
热议问题