Project was create on GitLab server, but cannot be pushed.
Just tried to push a new webstorm project on git lab project and get
Project was create on GitLab server, but cannot be pushed.```
Same here with PhpStorm 2017.1.4, Build #PS-171.4694.2 and IntelliJ IDEA 2017.1.5, Build #IU-171.4694.70
Also Cloning from repos not possible, even if they're public.
Clone failed: Could not read from remote repository.
Same here. PyCharm 2017.2 If I try to share project on gitlab it says: 18:39 Cannot Be Pushed: Project was create on GitLab server, but cannot be pushed.
Upd. Manual generation of SSH key for repo (I used Git GUI), and adding that key to SSH keys on Git Lab solved the problem.
This sounds like you do not have correct user rights to push to your gitlab server. The plugin will not do the SSH key generation for you, you need to do this manually, as suggested by @brstra
i have the same issue and the ssh key are correctly generated and installed on gitlab (gitlab is installed on my own server), something else to check ?
Hi. And if you try to do git push in terminal does it work?
I don't use the plugin, I just connect to git directly (via webstorm) and it works fine now.
+1 with this issue, im trying to push to a group and it will not have any. I am the owner of this group which is odd.
I tried replicating this but no luck.
Do you have some unstaged changes? Edited uncommitted files? Some changes on remote that are not present on your repo?
How the plugin works is that during merge request creation it will push the merged branch to the gitlab origin. It's using the same piece of code that rest of the IDE is using for pushing. But I am not really sure what happens when there is some kind of exception during push (when IDE asks you to merge, rebase, etc...)
Next time you get this error try pushing in IDE (Ctrl + Shift + K) Do you get any message? I am assuming that you must because otherwise it's the same code as plugin is triggering.
To prevent this next time take a action that will prevent this message from being displayed (Update from remote before pushing in 99%).
I have exactly the same problem: Intellij Idea and Rider. It creates the repository with but then failed with the message: ... cannot be pushed. If i try to push again, the this message appears: Failed with error: Could not read from remote repository.
I came up with a simple solution in the end - I just used GitHub :P
Solved for me for now... generated and added new ssh key... working now.
@PavlikPolivka I'm able to reproduce the problem on command. To reproduce, create a new project in Android Studio, set its vcs to git (from no vcs), then use your plugin's "VCS/Import into Version Control/Share on GitLab..." menu/option. When you do, if you select for Auth Type "SSL", the push fails. If you set it to "HTTP", you'll get an additional dialog titled 'Git Push', prompting for credentials for https://gitlab.com, specifically Login and Password. If you do not enter credentials, you'll get the same identical push failure message. You can delete the empty project in gitlab and then redo the above and you'll be able to recreate. Its seems, as you mentioned previously, that additional setup needs to be done to be able to push (vs. initially create the project remotely).
For future folks looking for a solution:
I was trying to push a new project to a new GitLab repo using the
VCS -> Import into Version Control -> Share on GitLab command.
The GitLab Projects plugin in PyCharm can create and populate using the GitLab access token without trouble.
In WebStorm it doesn't work. The Share on GitLab command will create the repo on GitLab but will not populate it. You get the error "Cannot Be Pushed: Project was create on GitLab server, but cannot be pushed." This problem occurs even if you already have an SSH key generated for your system.
@brstra identified the solution above. Open Git Gui, open the repo you are trying to push, go to Help -> Show SSH Key. Copy it to your clipboard and shove it into gitlab.com -> User Settings -> SSH Keys
@PavlikPolivka Whether it is the plugin, gitlab.com, or some other cause I cannot say, but the plugin does behave differently in PyCharm and WebStorm. Thank you for providing this valuable tool!
Don’t use this plugin just push to git manually
Kind regards
Nikos Katsikanis