使用 Ubuntu Git 和 msysgit 直接处理相同的文件
我知道通常情况下,使用来自不同操作系统的 Git 来处理相同的存储库是没有问题的,但我想知道这个特定的场景是否是一个例外。您认为这种工作方式有什么问题吗?
我们有一个 Ubuntu 服务器,上面有多个 Git 存储库。 Git 安装在服务器上,有时人们会通过 SSH 来获得远程访问并直接通过 shell 使用安装在该服务器上的 Git(是的,我知道这很奇怪,标准是有一个本地克隆的 Git 存储库,而不是使用远程 Git 安装)。
在我的 Windows 7 工作站上,我使用 WebDrive 将 Ubuntu 服务器中的目录映射为我的计算机上的网络驱动器,即使我的计算机位于完全不同的网络上。这可以通过 SSH 进行。我想使用 Windows 7 计算机上的 git 安装来处理此驱动器上的文件,就好像它们是本地文件一样。我将执行诸如从 Ubuntu 服务器上的 Git 安装创建并继续使用的存储库进行克隆、拉取和推送等操作。
我看不出这会产生任何标准使用 Git 时通常不会遇到的问题,但我只是想确定一下(我不想有一个损坏的存储库)。另外,这样工作时有什么需要注意的地方吗?
编辑:我的要求刚刚改变了。我还需要使用 msysgit 直接提交(除了拉取和推送之外)到使用 Ubuntu git 创建的存储库。
I know that normally there are no problems using Git from different OSs to work with the same repositories, but I want to know if this particular scenario would be an exception to that. Do you see any problems working this way?
We have an Ubuntu server with several Git repositories on it. Git is installed on the server and sometimes people will SSH in to gain remote access and use Git that is installed on that server directly through the shell (yes I know that is weird and the standard would be to have a local cloned Git repository instead of using the remote Git installation).
On my Windows 7 workstation I am using WebDrive to map a directory from the Ubuntu server as a network drive on my computer even though my computer is on a completely different network. This works over SSH. I want to use the git installation on my Windows 7 computer to work with the files on this drive as if they were local. I will be doing things like cloning from, pulling from, and pushing to repositories that were created and continue to be used by the Git installation from the Ubuntu server.
I can't see any reason that this would create any problems that you would not normally run into with the standard use of Git, but I just wanted to make sure (I don't want to have a corrupt repository). Also, is there anything I should watch out for when working this way?
EDIT: My requirements just now changed. I will also need to do direct commits (in addition to pulls and pushes) using my msysgit to a repository that was created with the Ubuntu git.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要确保当您提交时,行结尾是
原样
或unix-style
(认为msysgit说后者是跨平台项目的推荐)这是一个安装 msysgit 时看到的屏幕:http://lostechies.com/jasonmeridth/files/2011/03/msysgit_install8_69176BC0.png
您也可以轻松查看/更改这是来自 Git 扩展设置(如果您正在使用它),但它是将
core.autocrlf
设置为false
或input
其他需要确保的是您在 Ubuntu 和 Windows 上使用相似版本的 git / msysgit。
Just make sure that when you are committing the line endings are
as is
orunix-style
( thought msysgit says the latter is the recommended for cross-platform projects ) This is one of the screens that you see while installing msysgit:http://lostechies.com/jasonmeridth/files/2011/03/msysgit_install8_69176BC0.png
You can also easily see / change this from Git Extensions settings ( if you are using it ) but it is about setting
core.autocrlf
tofalse
orinput
Other thing to ensure is that you are using similar versions of git / msysgit on both Ubuntu and Windows.