如何访问 Windows 共享上的 git 存储库?
我希望能够将工作存储库从我的 Windows 7 桌面同步到我的 Windows 7 笔记本电脑,而无需将我的提交推送到我们的主服务器。我该怎么做?我不知道如何设置远程路径以便 git 可以了解它在哪里。我通常使用 Git Bash 来处理 git,而不是 Windows 命令行,所以这里的问题可能是我无法弄清楚如何在 Git Bash 中编写引用 Windows 共享的路径。
所以,假设我在(Windows 共享路径)有一个存储库:
\\\\MyWorkPCName\dev\myrepo\
并且在命令行中,我可以访问目录和文件(尽管使用 Pushd 因为 cmd 很愚蠢),我如何将其转换为有效的 git 远程?
I want to be able to sync a work repo from my Windows 7 desktop to my Windows 7 laptop without pushing my commits to our main server. How do I do this? I can't figure out how to set up a remote path so that git can understand where it is. I generally use Git Bash for dealing with git, not the windows commandline, so the issue here is likely that I can't figure out how to write a path in Git Bash which will reference a windows share.
So, say I have a repo at (windows share path):
\\\\MyWorkPCName\dev\myrepo\
And in the command line, I can access the directories and files (albeit using pushd since cmd is stupid), how do I convert this in to a valid git remote?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然 Git 无法识别反斜杠,但 Windows 可以识别正斜杠:
Git Bash 还允许您使用 UNIX 样式路径访问 Windows 驱动器,例如 C:\Users\bug\repo 变为
/c/Users/bug/repo
。While Git doesn't recognize backslashes, Windows does recognize forward slashes:
Git Bash also lets you access windows drives using UNIX-style paths, e.g.
C:\Users\bug\repo
becomes/c/Users/bug/repo
.