如何使用Intellij IDEA远程开发我的项目?

huangapple go评论71阅读模式
英文:

How to develop my project remotely using IntellijIDEA?

问题

我想在我的项目上远程工作,但我的项目文件存储在我办公室里的另一台机器上。我不想使用桌面共享,因为它会消耗大量流量并且很慢。我想要在我的本地IntelliJ中工作,但文件需要从我办公室的计算机提供。有什么解决方案吗?

英文:

I want to work remotely on my project but my project files are on the other machine in my office. I don't want to use Desktop Sharing because it uses a lot of traffic and it is slow. I want to work with my LOCAL intellij but files would serve from my computer in office. Is there any approach?

答案1

得分: 1

我认为这不会起作用,IntelliJ的构建理念是基于文件位于本地驱动器的前提,而且如果项目比较庞大,它仍然会变得很慢。这取决于您的安全设置、网络速度等。

您可以尝试以下方法:

  1. 在工作中创建一个网络驱动器来存储代码,在本地计算机上映射该驱动器,这样IntelliJ会“认为”它是一个常规的文件系统,但实际上文件将存储在远程位置。我个人认为这会非常慢,但您可以尝试,这是我认为最接近您问题的答案。

  2. 使用X Server从在工作中运行的IntelliJ流式传输图形到您的本地计算机。在这种设置中,工作计算机将运行IntelliJ进程,并且所有文件也将存储在那里。您的本地计算机将显示图形。通常情况下,在工作中使用Linux时,我有时会使用诸如MobaXTerm之类的程序进行这样的操作,可能还有其他类似的程序。

  3. 在Windows上通过远程桌面连接到您的计算机 - 正如您所说,这会很慢,但仍然是一种解决方案,可能更快的互联网速度可以解决问题:)

  4. 到目前为止,我能推荐的最佳选择是利用Git的分布式特性。假设您的项目由Git管理(即使不是,也请考虑使用源代码控制)。然后从以下两个选项中检出项目的副本...

选项A:...从托管组织项目源文件的远程中央仓库检出

选项B:...从您在工作中的计算机检出,在Git中定义“远程源”(我知道这不是关于Git的问题,但您可以使用(git remote add <您在工作中的计算机> +选择适合您的协议:ssh、git内部协议、http等)

然后您将在本地编译项目(您可能需要在本地计算机上安装像Maven、Gradle等构建工具,然后使用您本地安装的IDE进行快速开发。当您准备好“提交”您的代码时,您可以将其推送到上游。在选项A中,它将是远程仓库,就像您可能已经在工作中做的那样,在选项B中,您将推送到工作计算机上的远程分支。这将非常快速,我以前经常这样工作。

英文:

I don't think it will work, IntelliJ is built around the idea that the files are on the local drive, and if its a descent project it still will be slow.
Depending on your security settings, internet speed, etc.

You can try the following:

  1. At work create a network drive that stores the code and on your local computer map this drive, so intelliJ will "think" that its a regular File System but in fact the files will be stored remotely. I personally believe that it will be really slow, but you can try, this is the closest answer to your question I believe.

  2. Use X Server and stream the graphics from the intelliJ that runs on your server at work to your local PC. In such a setup the computer at work will run the intelliJ process and all the files will be stored there too. Your Local PC will show the graphics. Usually this works when you have linux at work, I do this sometimes with programs like MobaXTerm, probably there are others

  3. Connect to you computer with remote desktop on Windows - as you say its slow but its still a solution, probably faster internet can solve the issue 如何使用Intellij IDEA远程开发我的项目?

  4. By far the best option I can recommend: Use git's distributed nature. Assuming your project is managed by git (and if it isn't - consider using source control anyway).
    Then checkout the copy of the project from... Here are two options:

Option a: ...from the remote central repository that hosts the source files of your project in your organization

Option b: ... from your computer at work, you can define in git the "remote source" (this question is not about git, I know but you can use (git remote add &lt;your computer at work&gt; + chose the protocol that will work for you best: ssh, git internal protocol, http, etc)

Then you'll compile the project locally (you might have to install build tools like maven, gradle, etc. on your local computer and then by using your locally installed IDE you will be able to develop fast. Now when you're ready to "submit" your code - you can push it upstream. In the option A it will be the remote repo like you probably already do at work, with option B you will push to remote branch on your computer at work.
This will be pretty fast and I used to work like this a lot of times.

huangapple
  • 本文由 发表于 2020年10月19日 13:53:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/64421828.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定