IDEA IntelliJ git 克隆

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6351366/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 11:10:47  来源:igfitidea点击:

IDEA IntelliJ git clone

gitintellij-idea

提问by soappatrol

I am new to git and IntelliJ. I would like to get the source code for a project from a remote git repository and work on it using IntelliJ. I am use to Eclipse and SVN which has a "Checkout as Project" dialog.

我是 git 和 IntelliJ 的新手。我想从远程 git 存储库获取项目的源代码并使用 IntelliJ 进行处理。我习惯了 Eclipse 和 SVN,它们有一个“Checkout as Project”对话框。

I tried using "Check out from version control" but w/o any success.

我尝试使用“从版本控制中签出”但没有任何成功。

  • As the "GIT Repo URL" I entered git+ssh://[email protected]:/var/git/myProject
  • As the "Parent Dir" I added local directory /home/myName
  • As the "Dir Name" I added myProject
  • 作为我输入的“GIT Repo URL” git+ssh://[email protected]:/var/git/myProject
  • 作为“父目录”,我添加了本地目录 /home/myName
  • 作为我添加的“目录名称” myProject

I pressed the clone button and nothing happend on the IDE. It does create the directory /home/myName/myProjectwith the .gitconfigs but nothing has been fetched from the remote repository nor has the "New Project" Wizzard come up.

我按下了克隆按钮,IDE 上没有任何反应。它确实/home/myName/myProject使用.git配置创建了目录,但没有从远程存储库中获取任何内容,也没有出现“新项目”向导。

Can someone shed some light on how this would be done using IntelliJ and Git compared to Eclipse and SVN? I am using IDEA 10.5 and Fedora LINUX OS.

与 Eclipse 和 SVN 相比,有人可以解释一下如何使用 IntelliJ 和 Git 来完成这项工作吗?我使用的是 IDEA 10.5 和 Fedora LINUX 操作系统。

回答by gabuzo

With IntellIJ 12.0.3 VCS/Check out from Version Control/Git

使用 IntellIJ 12.0.3 VCS/从版本控制/Git 检出

Check out from Git on Mac

从 Mac 上的 Git 检出

回答by David Vaughan

With intelliJ, there is always going to be something that could do with improvement. In this particular instance, you will have a fetching progress indicator at the bottom of your window.

有了intelliJ,总会有一些可以改进的地方。在这种特殊情况下,您将在窗口底部有一个获取进度指示器。

If you create a blank project (with no modules) first, then use the Version Control -> Checkout from version control -> Git, you will have a "version control" tab at the bottom of your window where you can at least see the commands sent to git. There is still no progress shown, and if you are lucky like me, it'll sit there silently for ages while git drip feeds the repo with 40kb/s (and we're on a 100 MB connection).

如果您首先创建一个空白项目(没有模块),然后使用Version Control -> Checkout from version control -> Git,您将在窗口底部有一个“版本控制”选项卡,您至少可以在其中看到发送到 git 的命令。仍然没有显示任何进展,如果你像我一样幸运,它会静静地坐在那里很长时间,而 git drop 以 40kb/s 的速度为 repo 提供数据(我们使用 100 MB 的连接)。

Eventually, it'll allow you to then create a new project for this repo and the tags/branches in your repo will spew out in the version control info panel (that other tab). It works, but its too damn quiet.

最终,它将允许您为此存储库创建一个新项目,并且存储库中的标签/分支将在版本控制信息面板(另一个选项卡)中显示出来。它有效,但它太安静了。

回答by ?smail Yavuz

I use IntelliJ IDEA 2019.3 and this works to clone, import and (optionally) open the project in intelliJ:

我使用 IntelliJ IDEA 2019.3,这适用于在 IntelliJ 中克隆、导入和(可选)打开项目:

File --> New --> Project From Version Control...