git 将 bitbucket 导入 PHPStorm

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18932693/
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 17:01:30  来源:igfitidea点击:

Import bitbucket into PHPStorm

gitphpstorm

提问by Marc Rasmussen

I feel like I have tried Everything but I keep getting a clone fail error:

我觉得我已经尝试了一切,但我不断收到克隆失败错误:

Here is what I did

这是我所做的

Open PHPStorm ->VCS -> Checkout from Version Control -> Git

In Git Repository URL: I insert https://[email protected]/MrRasmussen/udlejnings-priser.git

在 Git 存储库 URL 中:我插入 https://[email protected]/MrRasmussen/udlejnings-priser.git

Parent Directory: C:\xampp\htdocs

父目录: C:\xampp\htdocs

Directory name: udlejnings-priser

目录名称: udlejnings-priser

Now when I press Test I get the following error:

现在,当我按 Test 时,出现以下错误:

Repository test has failed.

What am I doing wrong?

我究竟做错了什么?

采纳答案by Games Brainiac

You cannot have any @symbols. You need to get a url that does not have this. For example, if you try to clone from this URL:

你不能有任何@符号。你需要得到一个没有这个的网址。例如,如果您尝试从此 URL 进行克隆:

https://github.com/gamesbrainiac/requests.git

It will work fine.

它会正常工作。

回答by H. Paúl Cervera García

I recommend you to download a bitbucket plugin for PHPStorm. File > Settings > [Search for] plugins > Browse repositories > [Search for] Bitbucket

我建议您为 PHPStorm 下载一个 bitbucket 插件。文件 > 设置 > [搜索] 插件 > 浏览存储库 > [搜索] Bitbucket

It will help you to clone your projects.

它将帮助您克隆您的项目。

回答by dfs

An alternate bitbucket plugin released by atlassian - works better than the jetbrains plugin for me. https://bitbucket.org/dmitry_cherkas/jetbrains-bitbucket-connector/downloads

atlassian 发布的另一个 bitbucket 插件 - 对我来说比 jetbrains 插件效果更好。 https://bitbucket.org/dmitry_cherkas/jetbrains-bitbucket-connector/downloads

  • Download and extract the most recent zip file - ex: jetbrains-bitbucket-connector_IC-139.224.zip
  • Select Install from disk option and point to the bitbucket.jar file within the folder you just extracted
  • 下载并解压最新的 zip 文件 - 例如:jetbrains-bitbucket-connector_IC-139.224.zip
  • 选择从磁盘安装选项并指向刚刚解压的文件夹中的 bitbucket.jar 文件

回答by maskitto

The BitBucket plugin does not work with the latest version of Phpstorm (8.0.3 build 139.1348)

BitBucket 插件不适用于最新版本的 Phpstorm (8.0.3 build 139.1348)

Games Brainiac's answer, although not addressing BitBucket directly does help solving the issue. Taking the @ from the url forces to also get rid of the username, so, the url becomes https://bitbucket.org/[user]/[repository].git

Games Brainiac 的回答虽然没有直接解决 BitBucket,但确实有助于解决问题。从 url 中取@ 强制也去掉用户名,因此,url 变为https://bitbucket.org/[user]/[repository].git

This brings up the authentication window in Phpstorm and starts cloning the repo.

这会在 Phpstorm 中打开身份验证窗口并开始克隆 repo。

回答by BonifatiusK

Maybe a bit late, since an answer was given. At this point (PHPStorm version 10.0.3) but earlier on also: You canuse an @ in the repository link.

也许有点晚了,因为给出了答案。此时(PHPStorm 版本 10.0.3)但更早:您可以在存储库链接中使用 @。

You do need to download and install Git on your windows machine. See the link here: https://git-scm.com/downloads/

您确实需要在 Windows 机器上下载并安装 Git。请参阅此处的链接:https: //git-scm.com/downloads/

Then you need to go to add the git.exe path to the git executible path in the plugin settings. Go to File -> Settings (or press CTRL + ALT + S)

然后你需要去插件设置中将git.exe路径添加到git可执行路径中。转到文件 -> 设置(或按 CTRL + ALT + S)

回答by Albert

I know this is an old question, but this solution worked for me. I also tried cloning directly from the welcome screen. However, no luck.

我知道这是一个老问题,但这个解决方案对我有用。我还尝试直接从欢迎屏幕克隆。然而,没有运气。

What I did was I opened an existing project, clicked on VCS -> Checkout from Version Control -> Gitand entered all the details there. When I tested it, it asked for a password for my BitBucket account and it worked.

我所做的是打开一个现有项目,单击VCS -> Checkout from Version Control -> Git并在那里输入所有详细信息。当我测试它时,它要求为我的 BitBucket 帐户输入密码并且它起作用了。

回答by Albert

When using Bitbucket to clone into your localhost and IDE, you have several options:

使用 Bitbucket 克隆到本地主机和 IDE 时,您有多种选择:

  • clone via SSH
  • clone via HTTPS
  • 通过 SSH 克隆
  • 通过 HTTPS 克隆

When using HTTPS, the problem is that Bitbucket's default URL format is

使用HTTPS时,问题是Bitbucket的默认URL格式是

https://[email protected]/username/repo.git

Many programs do not like this (special @ character in URL), not just PhpStorm. Another problem is that Bitbucket now only returns a generic 403 error even when you're able to connect but something goes wrong.

许多程序不喜欢这个(URL 中的特殊@ 字符),不仅仅是 PhpStorm。另一个问题是,即使您能够连接但出现问题,Bitbucket 现在也只返回一般的 403 错误。

So the recommended options are:

所以推荐的选项是:

  • connect manually by later editing the ./git/config file or via command line
  • connect using the JetBrains Bitbucket connector plugin
  • 通过稍后编辑 ./git/config 文件或通过命令行手动连接
  • 使用 JetBrains Bitbucket 连接器插件进行连接

Remember that in both cases you must specify repo URL including your passwordsuch as:

请记住,在这两种情况下,您都必须指定包含密码的 repo URL,例如:

https://username:[email protected]/username/repo.git

If you use the default Bitbucket URL, it will work in some other IDEs (such as Netbeans) but not in PhpStorm.

如果您使用默认的 Bitbucket URL,它可以在其他一些 IDE(例如 Netbeans)中工作,但不能在 PhpStorm 中工作。

Also when using the connector plugin, by default you'll be able to use only one Bitbucket account. To use a different one, again, you need to edit the repo URL manually.

此外,在使用连接器插件时,默认情况下您只能使用一个 Bitbucket 帐户。要使用另一个,您需要手动编辑 repo URL。