用于单独项目的 GIT GUI:用于开发的 Windows PC,但 git + LAN 无头 Linux 服务器上活跃的、工作的项目存储库?

发布于 2024-11-18 07:03:17 字数 641 浏览 2 评论 0原文

我刚刚为一个独立项目第一次安装了 git —— 现在我不知道我是如何在没有版本控制的情况下生活这么久的。我想看看 GUI 是否会有帮助,但我有一个问题...

  • 我的开发机器正在运行 Windows
  • 该项目位于 LAN 上的无头 Linux 服务器上
  • 项目目录通过 samba 共享并映射为网络驱动器windows pc
  • 我是唯一使用此服务器的人,因此无需将存储库克隆到 windows pc
  • 如果我通过 SSH 使用 git,这根本不是问题 到目前为止

我尝试过的 GUI git 客户端都假设我正在运行 git不过,我安装它们的机器。如果我尝试使用 widnows 安装的 git 在 linux 托管的存储库上进行操作,它会(不出意料地)像糖蜜一样慢,并且似乎存在兼容性问题。

有什么办法可以让 smartgit 工作起来吗?或者还有其他靠谱的客户吗?

我确实安装了 gitweb,它看起来足够好,可以查看项目历史记录,但我实际上无法用它“做”任何事情。

编辑:如果我可以扩大这个问题,只是询问有关如何继续的建议,即:忍住并使用 Putty 和其他东西进行可视化,克隆存储库并推/拉,或者做一些不同的事情,比如 svick 的 X Server 建议。

I just installed git for the first time for a solo project -- and now I don't know how I lived without version control for so long. I wanted to see if maybe a GUI would be helpful, but I have a problem...

  • My development machine is running windows
  • The project is on a headless linux server on the LAN
  • Project directories are shared through samba and mapped as network drives on the windows pc
  • I am the only one using this server, so there's no need to clone the repo to the windows pc
  • If I use git through SSH none of this is a problem at all

The GUI git clients I've tried so far all assume I'm running git on the machine I install them on, though. If I try to operate on the linux-hosted repo with widnows-installed git, it's (not unexpectedly) slow as molasses and seems to have compatibility issues.

Is there any way to make this work for smartgit? Or any other decent client?

I did install gitweb, which seems nice enough to look through project history, but I can't actually 'do' anything with it.

EDIT: If I could maybe broaden this question and just ask for a word of advice on how to proceed, ie: suck it up and use Putty with something else for visualization, clone the repo and push/pull, or do something different like svick's X Server suggestion.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

萌能量女王 2024-11-25 07:03:17

好吧,为了清晰而不是虚荣,我将把我自己的答案标记为正确,希望能帮助陷入类似困境的人。我希望没有人会被冒犯。

顺便说一句,在提出一个可行的解决方案之后,我仍然最终使用 SSH 和驱动器映射的共享 Linux 目录进行开发,但在 Windows 计算机上有一个本地位置来放置一个可用的存储库是很有用的。无论如何,GIT 对我来说就像窗户上的糖蜜一样慢,所以我会尽可能少地使用它——但这只是我的情况。

如果你的 bash-foo 像我的一样弱,webmin 可以帮助解决以下问题。所以这就是我最终要做的:

摘要:

  • 基于 Web 的项目(在我的例子中为 LAMP 堆栈)
  • 单独开发人员
  • 1 台 Windows 电脑用于开发
  • 1 台无头 Linux 服务器来托管堆栈和项目

目的:

  • 在 Windows PC 上本地设置一个工作存储库,以高效使用 git GUI 客户端等,而无需创建整个工作堆栈或提交并推送以查看到底发生了什么。 Windows 上的 PHP 很糟糕(是的,是的,比平常更糟糕),因此做了很多其他事情。

解决方案的优点:

  • 无需在 Windows 计算机上复制 LAMP 堆栈,也无需修改数据库即可获得可用的本地存储库
  • 实时预览您的更改,而无需提交或推送

解决方案缺点:

  • 本地(Windows)存储库仅在计算机连接到网络时才起作用。
  • 由于此处发生的循环循环性质,您可能会看到一点网络延迟

先决条件:

  • 基于静态或 MAC两个窗口的 IP和 Linux 机器 linux
  • 盒子上的 git、BIND、Samba、Apache(或类似的) Windows
  • 盒子上的 SSH 客户端(Putty?)、msysgit、git GUI(gitextensions/smartgit/gitgui)

要做什么:< /strong>

  1. 在 Windows 机器上为存储库设置一个共享目录
  2. 在 linux 机器上挂载此目录
  3. 将 BIND 指向您的两个域的 linux 机器自己的 IP(例如:myproject.lin 和myproject.win) -- (对假 TLD 表示歉意,但请自行判断)
  4. 将 linux 盒子作为 Windows 盒子或网络路由器的 dns 解析器
  5. 在 Apache 中设置两个基于域的服务器(上面的)并将它们定向到适当的位置(例如:'/mnt/windows-pc/myproject' 和 '/var/www/myproject')
  6. 确保您的应用程序配置可以映射相对路径,原因很明显
  7. Samba 共享 linux 存储库,也许为了方便起见,将其映射为 Windows 网络驱动器
  8. 将 linux 盒子的存储库克隆到 windows 目录
  9. 根据需要将更改推送回 linux 共享项目目录

为了进一步复杂化可能几乎不需要任何解释的内容,这里有一个(简化的)图表:
我认为与裤子有关

Okay, I'll be marking my own answer correct for clarity and not vanity, to hopefully help someone caught in a similar predicament. I hope no one will be offended.

As, a side note, after coming up with a working solution, I still ended up using SSH and a drive-mapped shared linux directory for development, but it's useful to have a local place on the windows machine to put a working repo. GIT is just slow as molasses on windows for me no matter what, so I'll be using it that way as little as possible -- but that's just me.

If your bash-foo is weak like mine, webmin can help with the below. So here's what I ended up doing:

Summary:

  • Web-based project (LAMP stack in my case)
  • Solo developer
  • 1 Windows pc used for development
  • 1 headless linux server to host the stack and the project

Purpose:

  • Set up a working repo locally on the windows PC to enable efficient use of git GUI clients, etc without having to make a whole working stack or commit and push to see what the hell just happened. PHP on windows sucks (yes, yes, more than usual har har), and so do a lot of other things.

Solution upside:

  • No need to duplicate the LAMP stack on the windows machine, or screw with the database to have a working local repo
  • Preview your changes in real-time without having to commit or push

Solution downside:

  • Local (windows) repo only functional if computer is on the network
  • You might see a bit of network latency due the loopty-loo nature of what's happening here

Prerequisites:

  • Static or MAC based IPs for both the windows and linux machines
  • git, BIND, Samba, Apache (or similar) on the linux box
  • SSH client (Putty?), msysgit, git GUI of choice (gitextensions/smartgit/gitgui) on the windows box

What to do:

  1. Set up a shared directory on the windows box for the repo
  2. Mount this directory on the linux box
  3. Point BIND to the linux box's own IP for your two domain (eg: myproject.lin and myproject.win) -- (apologies for the fake tlds, but use your own discretion here)
  4. Make the linux box your dns resolver for either the windows box or your network router
  5. Set up two domain-based servers in Apache (the ones above) and direct them to the appropriate locations (eg: '/mnt/windows-pc/myproject' and '/var/www/myproject')
  6. Make sure your application configuration can map relative paths for obvious reasons
  7. Samba-share the linux repo and maybe map it as a windows network drive for convenience
  8. Clone your linux box's repo to the windows directory
  9. Push changes as needed back to the linux shared project directory

To further complicate what probably hardly needed any explanation here is a (simplified) diagram:
something to do with pants i thinks

傲鸠 2024-11-25 07:03:17

我是唯一使用此服务器的人,因此无需将存储库克隆到 Windows 电脑

。实际上,似乎有一些需要。如果您希望存储库像本地存储库一样快,最简单的选择是实际创建本地存储库。

另一种选择是在 Windows 计算机上安装 X Server,并使用通过 SSH 的 X 隧道在 Linux 服务器上运行 git GUI,但在 Windows 上显示它。

I am the only one using this server, so there's no need to clone the repo to the windows pc

Actually, it seems there is some need. If you want the repository to be as fast as if it was a local repo, the easiest option is to actually create a local repo.

Another option would be to install X Server on the Windows machine and use X tunneling over SSH to run the git GUI on the Linux server, but display it on Windows.

青春如此纠结 2024-11-25 07:03:17

DVCS 的优点在于您可以在本地计算机上获得存储库的完整本地副本。就 git 而言,几乎假设您将在本地克隆或(至少)存储存储库。

现在,您已经声明克隆它并不理想,但事实是为了使 GUI 有效,它需要在本地存储库所在的位置运行。

根据您的工作流程/设置,这可能可行,也可能不可行。我的建议是:

  1. 在本地工作站上安装 XAMPP,即使需要投入大量时间。
  2. 引入存储库并将您的 Linux 站点添加为远程站点,或者(理想情况下)设置类似 gitolite
  3. 本地开发。将其视为“阿尔法”阶段。您在这里可以获得额外的好处 - 您基本上可以搞砸整个应用程序,并且它不会上线。还有你的图形用户界面!
  4. git push 到远程存储库,然后部署。

现在,如果您有资源,有一些更好的方法可以真正解决这个问题,我已在 其他帖子。再说一遍,如果您有足够的灵活性来做这样的事情,我强烈推荐它。如果这太激进,你可能必须坚持你正在做的事情。希望这有帮助。

PS:我也是一名独立开发人员,我在版本控制设置上投入了大量时间。它得到了回报!

The beauty of DVCS is that you're getting an entire, local copy of the repo on your local machine. In the case of git, it's almost assumed that you're going to be cloning or (at the minimum) housing the repository locally.

Now, you've stated that it isn't ideal for you to clone it over, but the fact is that in order for the GUI to be effective, it's going to need to be running where the repo is locally.

Depending on your workflow/setup, this may or may not be feasible. Here's my suggestion:

  1. Setup XAMPP on your local workstation, even if it is a huge time investment to get going.
  2. Bring the repository in and add your Linux station as a remote, or (ideally) setup something like gitolite
  3. Develop locally. Think of it as an "alpha" stage. You get additional benefits here - you can basically screw up your entire app and it won't be live. And your GUI!
  4. git push to the remote repo, and ta-da, deployed.

Now, there's a few better ways to really get into this if you have the resources, and I've detailed them in other posts. Again, if you have the flexibility to do something like this, I highly recommend it. If that's too radical, you might have to stay the course with what you're doing. Hope this helps.

PS: I'm a solo developer as well, and I put a LOT of time into my version control setup. It has paid off!

暗地喜欢 2024-11-25 07:03:17

我有一个类似的配置,并在目标 Linux 机器上运行克隆。不过,我也在 Windows 中使用 ssh 在无头 Linux 机器上进行开发。我在 Win7/64 上运行 Xming。因此,对于此活动,Windows 盒子几乎只是一个 X 终端。

我在 Linux 机器上安装了 gnome-terminal,因为我对 putty 或在 Windows 命令窗口中运行的 xmingw bash 都不满意。

它并不完美,但已被证明是可行的。

I have a comparable configuration and I run a clone on the target Linux box. However I also develop on the headless Linux box using ssh from Windows. I'm running Xming on Win7/64. So for this activity the Windows box is pretty much just an X-terminal.

I have installed gnome-terminal on the Linux box, because I'm not happy with either putty or the xmingw bash that runs in a Windows command window.

It ain't perfect, but it's proven to be workable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文