How to setup PC and Mac for using git

2019-08-02 12:08发布

I use git both for Mac and PC.

When pulling Mac's git from PC, it's easy as I can use ssh.

git clone smcho@prosseek:~/smcho/setup

The problem happens the other way round : to pull from Mac. I guess there are two ways to go.

Method 1 : Connect to server

By using 'connect to server' in Mac, I can make PC's directory like that of Mac. Even though, the file permission issue, it works pretty well.

Method 2 : ssh

I could run cygwin ssh server (cygrunsrv -S sshd) to be accessed from other computers, but for me, I have to wait quite a while to get connection as I explained here. It's almost impossible for to use it with git, as I don't want to wait for minutes to get clone.

Here comes my question.

  • Is there any better way other than the previous two methods?
  • Is there a (natural) way to support ssh server from Windows (windows 7 precisely) not using cygwin?

4条回答
对你真心纯属浪费
2楼-- · 2019-08-02 12:31

I see two other solutions :

  • using a third synchronisation server: GitHub, the most famous (if your program is OpenSource), but you can also find free online private Git repositories
  • on Windows, you can set up the Git server ('git daemon' command). On MAC, you'll access to the Windows repository using the URL git://ip_of_windows_machine/repository/
查看更多
贪生不怕死
3楼-- · 2019-08-02 12:32

You might consider another approach entirely. If you're using git as a revision control system that you might consider a hosted account for mastering your repository, maintaining backups, etc. http://github.com/ is the leader in the space for git.

查看更多
神经病院院长
4楼-- · 2019-08-02 12:36

I've started using the philosophy of trying to stick in the native environment that something is designed for.

With that in mind, my windows box has an ubuntu server virtual machine that hosts my git repositories. The nice thing is the linux + virtual box + git is an awesome source repository that is completely free. No extra machine and you can give it very little memory so it isn't a resource hog.

查看更多
Deceive 欺骗
5楼-- · 2019-08-02 12:57

There is even another option:

If you use both computers for developing and just want to keep the repositories in sync, you could create a bare repository and use something like Dropbox to synchronize it.

查看更多
登录 后发表回答