git:如何在多台PC之间正确共享本地副本 [英] git: how to properly share local copy between multiple PCs

查看:69
本文介绍了git:如何在多台PC之间正确共享本地副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拉了一些公共存储库,在这里和那里进行了很少的更改.我将它们提交给我的本地副本.我经常从远程拉动,以从公共存储库中获取更改.有时,我在不同PC上的本地副本上工作,我需要在PC之间移动整个源代码,以便它们共享完全相同的更改.几次我搞砸了复印,丢失了一些本地更改.所以我的问题是:如何在其中一台PC上设置某种本地git服务器,以便仍可以从该公共存储库中提取更改,并将本地更改提交到本地git服务器,以便能够同步我在多台PC之间进行工作而不复制完整的源代码三?

I pull'ed some public repository, made few changes here and there. I committed them to my local copy. I regularly pull from remote to get changes from the public repo. Occasionally, I work on that local copy from different PC's and I need to move entire source code between PCs so that they share exactly the same changes. A few times I messed up copying and lost some of my local changes. So my question is: how can I set up some sort of local git server on one of the PCs so that I could still pull changes from that public repo and commit my local changes to my local git server so that I would be able to synchronize my work between multiple PCs without copying full source three?

我使用Windows

I use Windows

推荐答案

请记住,git存储库最终只是磁盘上的一组文件.

Remember that a git repository is ultimately just a set of files on disk.

您可以将您的主要本地git存储库放在网络共享上,然后在同一LAN上的其他计算机上使用回购推送/拉取.

You can put your main local git repository on a network share and then push / pull with repos on other computers on the same LAN.

过去,这对我来说效果很好(服务器上的主存储库,笔记本电脑,台式机等的其他存储库)

This has worked well for me in the past (main repo on a server, other repos on laptops, desktop PCs etc.)

这篇关于git:如何在多台PC之间正确共享本地副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆