我的笔记本电脑上设置了本地 Git 存储库。我想把它推到我的桌面上。
我怎样才能做到这一点?
如果您有权访问共享目录,则可以(请参阅git clone http://git-scm.com/docs/git-clone and git remote http://www.kernel.org/pub/software/scm/git/docs/git-remote.html):
git clone --bare /path/to/your/laptop/repo /shared/path/to/desktop/repo.git
git remote add desktop /shared/path/to/desktop/repo.git
这将创建一个裸仓库 https://stackoverflow.com/questions/738154/what-does-git-updating-currently-checked-out-branch-warning-mean,在本地存储库中称为“桌面”。
由于它是裸露的,因此您可以推它(如果需要也可以从中拉出)
git push desktop
As the ProGit 书中提及 http://progit.org/book/ch4-1.html,git确实支持文件协议:
最基本的是Local协议,其中远程存储库位于磁盘上的另一个目录中。
如果团队中的每个人都可以访问共享文件系统(例如 NFS 安装),或者在每个人都登录到同一台计算机的不太可能的情况下,通常会使用此方法。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)