在本地使用 Netbeans,在远程服务器上使用 git(客户端) [英] Using Netbeans on local and git (client) on remote server

查看:73
本文介绍了在本地使用 Netbeans,在远程服务器上使用 git(客户端)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在远程服务器上运行的 php 应用程序,而 Netbeans 则在本地机器(远程项目)上运行.这个应用程序是一个开源软件,我想对其进行一些更改以供私人使用,但我也会定期从上游 git 服务器更新核心并合并我的更改.我可以在远程服务器上安装 git 并使用它来获取和拉取更新并使用本地的 Netbeans 来可视化差异吗?或者我必须在本地机器上安装 Web 服务器和 git 才能利用 Netbeans?

I've a php application that runs on a remote server, Netbeans instead runs on a local machine (remote project). This application is an open source software on which I want make some changes for private use, but I would also update the core regularly from the upstream git server and merge my changes. Can I install git on the remote server and use it to fetch and pull the updates and use Netbeans from local to visualize the diffs? Or I have to install a web server and git on local machine to take advantage from Netbeans?

推荐答案

在任何情况下,您都不需要本地计算机上的 Web 服务器.如果您想可视化 Netbeans 中的差异,那么它需要处理代码的检出副本.我可以想到几种方法来做到这一点,最好取决于您的工作流程以及远程项目是否处于活动状态.

You don't need a web server on the local machine in any case. If you want to visualize the diffs within Netbeans then it needs to be working on a checked-out copy of the code. I can think of a few ways to do this, which is best depends on your workflow and whether or not the remote project is live.

  • 检出远程服务器上的文件,然后通过网络共享(如通过 SSHFS)挂载该目录,以便 Netbeans 可以像处理本地文件一样处理这些文件.本地更改将立即出现在远程服务器上.有些人觉得这个方法太慢了,你的里程可能会有所不同.处理远程文件的性能从 Netbeans 7.4 提高到 8.0.您的 git 提交和合并可以在任何一台机器上完成.

  • Checkout the files on the remote server and then mount that directory via a network share (like via SSHFS) so that Netbeans can work with the files as if they were local. Local changes will appear immediately on the remote server. Some people find this method too slow, your mileage may vary. Performance of working with remote files has increased a bunch from Netbeans 7.4 to 8.0. Your git commits and merges can be done from either machine.

检出远程服务器上的文件.检出本地机器上的文件.使用 Netbeans 在本地开发.当您想在远程服务器上看到您的更改时,您必须从本地机器提交它们,然后将它们拉到远程.

Checkout the files on the remote server. Checkout the files on the local machine. Develop locally with Netbeans. When you want to see your changes on the remote server, you'll have to commit them from the local machine and then pull them to the remote.

在远程服务器上安装(而不是检出)文件.(就像通过 git-archive.)检出本地机器上的文件.配置 Netbeans 以在保存时上传到远程服务器.使用 Netbeans 在本地开发.您将拥有本地差异和即时远程更改.您所有的 git 工作都将在本地机器上完成,如果您搞砸了远程机器,您可以将其擦除并执行另一个 git-archive 以恢复最新版本.

Install (not checkout) the files on the remote server. (Like via git-archive.) Checkout the files on the local machine. Configure Netbeans to upload to the remote server on save. Develop locally with Netbeans. You'll have the diffs locally and instant remote changes. All your git work will be done from the local machine and if you screw up the remote, you can just wipe it out and do another git-archive to restore the latest version.

这篇关于在本地使用 Netbeans,在远程服务器上使用 git(客户端)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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