Git软件(例如Gitbox,Github,SourceTree)可以使用远程仓库而不是本地仓库吗? [英] Can Git software (e.g. Gitbox, Github, SourceTree) use a remote repo instead of local?

查看:111
本文介绍了Git软件(例如Gitbox,Github,SourceTree)可以使用远程仓库而不是本地仓库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢使用Git软件来推送提交,但是我使用的那些(Gitbox,Github,SourceTree)在向它们添加新存储库时都要求提供本地存储库.

I like using Git software to push commits, but the ones I use (Gitbox, Github, SourceTree) all ask for a local repo when adding a new repo to them.

问题是,我的存储库位于开发服务器上,而不是本地计算机上.

Thing is, my repo is on my development server not my local machine.

那么Git软件可以使用远程Git存储库作为开发存储库,然后将其推送到您的主存储库(例如Github或Bitbucket)吗?

So can Git software use a remote Git repo as a development repo, then push that to your main repo (e.g. Github or Bitbucket)?

否则,您似乎无法使用该软件,而不得不通过SSH求助于命令行.

Otherwise it seems you cannot use the software and have to resort to command line over SSH.

谢谢

推荐答案

不依赖于前端来直接支持远程回购的一种解决方案是将远程挂载为网络文件系统.如果您仅具有对远程计算机的SSH访问权限,则可以尝试通过 SSHFS fuse.sourceforge.net/">FUSE (在Linux上)或 OSXFUSE (在Mac OS X上).并进行设置后,您可以使用SMB,NFS,DAV或其他网络文件系统.

One solution, which doesn't rely on the front-end to support manipulating a remote repo directly, would be to mount the remote as a networked filesystem. If you only have SSH access to the remote machine, you could try using SSHFS via FUSE (on Linux) or OSXFUSE on Mac OS X. Or depending on your preferences and setup, you could use SMB, NFS, DAV, or another network filesystem.

我在注释中提到的另一种方法是将网络文件系统从开发计算机导出到服务器.我这样做是为了可以将当前的工作副本一次安装在多台计算机上,并且即使没有连接到服务器,我也仍然可以拥有本地的工作副本.

Another way to do it, that I bring up in the comments, is to export the network filesystem from your development machine to your server. I do this so that I can mount my current working copy on multiple machines at once, and also so that I still have my local working copy even when I'm not connected to the server.

您写:

令我惊讶的是git软件无法将远程回购作为工作版本.

I am surprised git software can't deal with remote repos as the working version.

大多数Git GUI通过调用git命令来完成一些工作.为了使它们支持远程操作,核心Git也必须这样做.它使用C和Shell脚本混合编写;所有这些都必须重写以应对远程文件.

Most Git GUIs do some of their work by calling out to the git command. In order for them to support remote operation, core Git would have to as well. It is written in a mix of C and shell script; all of that would have to be rewritten to cope with remote files.

文本编辑器的工作要简单得多;它会在您打开文件时读取一个文件,并在保存时写入一个文件,而Git在单个操作(例如commit)中读取和写入许多文件.

A text editor has a much easier job; it reads one file when you open it, and writes when you save, while Git reads and writes many files in the course of a single operation like commit.

网络文件系统意味着所有工具(Git和其他工具)都将对您的远程文件起作用.与其在每个应用程序中构建一个层来支持网络文件访问,不如在内核中(或通过FUSE)进行处理,然后将其像本地文件系统一样,为您免费提供对每个应用程序的支持.

A networked filesystem would mean that all tools (Git and otherwise) will work on your remote files. Instead of building a layer into each and every application to support networked file access, doing it in the kernel (or via FUSE) and then just treating it like a local filesystem gives you that support in every application for free.

这篇关于Git软件(例如Gitbox,Github,SourceTree)可以使用远程仓库而不是本地仓库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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