GitLabProjects icon indicating copy to clipboard operation
GitLabProjects copied to clipboard

Project was create on GitLab server, but cannot be pushed.

Open quantuminformation opened this issue 8 years ago • 14 comments

Just tried to push a new webstorm project on git lab project and get

Project was create on GitLab server, but cannot be pushed.```

quantuminformation avatar Jun 20 '17 14:06 quantuminformation

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.

itg-dave avatar Jul 13 '17 16:07 itg-dave

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.

brstra avatar Aug 14 '17 15:08 brstra

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

PavlikPolivka avatar Sep 27 '17 20:09 PavlikPolivka

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 ?

aityahiaidir avatar Dec 02 '17 23:12 aityahiaidir

Hi. And if you try to do git push in terminal does it work?

PavlikPolivka avatar Dec 03 '17 08:12 PavlikPolivka

I don't use the plugin, I just connect to git directly (via webstorm) and it works fine now.

quantuminformation avatar Dec 03 '17 08:12 quantuminformation

+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.

xtechgamer735 avatar Jan 07 '18 21:01 xtechgamer735

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%).

PavlikPolivka avatar Jan 14 '18 14:01 PavlikPolivka

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.

ghost avatar Jun 13 '18 18:06 ghost

I came up with a simple solution in the end - I just used GitHub :P

xtechgamer735 avatar Jun 13 '18 18:06 xtechgamer735

Solved for me for now... generated and added new ssh key... working now.

ghost avatar Jun 13 '18 18:06 ghost

@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).

aromanelli avatar Dec 07 '18 03:12 aromanelli

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!

dmlo avatar Jan 22 '19 22:01 dmlo

Don’t use this plugin just push to git manually

Kind regards

Nikos Katsikanis

quantuminformation avatar Jan 22 '19 23:01 quantuminformation