IntelliJ IDEA Bitbucket Git 集成不推送
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17393753/
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
IntelliJ IDEA Bitbucket Git integration not pushing
提问by Games Brainiac
I initiated my git repo in my IntelliJ IDEA project. Then I click on share via Bitbucket under "Import into Version Control" Note: I've installed the plugin from jetbrains repository.
我在我的 IntelliJ IDEA 项目中启动了我的 git repo。然后我在“导入到版本控制”下单击通过 Bitbucket 共享 注意:我已经从 jetbrains 存储库安装了插件。
All works fine, I even am able to create the repo on Bitbucket, but when I try to push, nothing happens. When I try again through VCS > GIT > Push, it says that there are no remotes defined.
一切正常,我什至可以在 Bitbucket 上创建 repo,但是当我尝试推送时,什么也没有发生。当我通过 VCS > GIT > Push 再次尝试时,它说没有定义遥控器。
Please help. I mean, there's no error message nothing. I manage to push to github just fine though.
请帮忙。我的意思是,没有任何错误消息。不过,我设法推送到 github 就好了。
回答by VonC
Following this answer, you might need to open the "Git Bash", and define a remote:
按照这个答案,您可能需要打开“Git Bash”,并定义一个远程:
git remote add origin http//IP/path/to/repository
git push -u origin master
In IntelliJ IDEA right-click on project select Synchronize 'YourProject'
在 IntelliJ IDEA 中右键单击项目选择 Synchronize 'YourProject'
For the reason behind the '-u
' (upstream branch) option, see:
"Why do I need to explicitly push a new branch?".
有关 ' -u
'(上游分支)选项背后的原因,请参阅:
“为什么我需要明确推送新分支?”。
回答by Games Brainiac
I've created a youtube Video addressing this issue. Thanks @VonC for your help.
我创建了一个 youtube 视频来解决这个问题。感谢@VonC 的帮助。
回答by arvindwill
Actually problem is intellj plugin has some problem in adding remote to repo when it was shared via plugin, so it is mandatory to add the remote manually
It is not necessary to execute push command since it can be done from IDE itself. Need to execute git remote add
.
实际上问题是intellj插件在通过插件共享时将远程添加到repo时存在一些问题,因此必须手动添加远程。没有必要执行push命令,因为它可以从IDE本身完成。需要执行git remote add
。
git remote add origin https://<username>@bitbucket.org/<username>/<reponame>
Best video to understand http://www.youtube.com/watch?v=klfLSRXUOzYfyi try to install the Command line console plugin for intellij before viewing the video.
最好理解的视频http://www.youtube.com/watch?v=klfLSRXUOzY仅供参考,在观看视频之前尝试安装 intellij 的命令行控制台插件。
回答by F0G
You've to create repo on Bitbucket, then change existing remote repository URL from Intellij Terminal:
您必须在 Bitbucket 上创建 repo,然后从 Intellij 终端更改现有的远程存储库 URL:
> git remote set-url origin https://<username>@bitbucket.org/<owner>/<newrepo>
And push with git push
.
并用git push
.