How to commit WebStorm project to Bitbucket?
I have created a BitBucket repository called 'Repo01'.
I have created a project using WebStorm called 'Project01'.
For Project01, i did 'VCS -> Import Into Version Control -> Create GIT Repository'.
I then commited all changes in Project01 to this local repo.
I then right clicked on Project01, selected GIT -> Repository -> Push
Here i provided the Repo01 URL, in both forms, SSH and HTTPS. Example - https://<username>@bitbucket.org/<username>/Repo01.git
For HTTPS URL, I get this error message - 'Remote URL test failed: unable to access ''https://...": The requested URL has returned 403.
For SSH URL, i get this error message - "Push rejected: Push to Repo01/master was rejected"
Why am i getting this error? And is there a better/correct way to commit my project to a remote BitBucket repository.
Note - Repo01 is Git, NOT Mercurial.
Note - I tried commit to this repo from Eclipse, and it works. So things on the Bitbucket side are working as expected.
Please sign in to leave a comment.
403 when using HTTP usually happens due to incorrect authentication. Were you prompted to enter a password when pushed using HTTP?
Push rejected message is usually returned when the remote repository has some commits missing in your local repository. Was it a first push to the repo?
The error message could have more details, btw. Check the Console tab for the full git command output.
I have decided to start from scratch.
I now have a project called 'Project01'.
I have a Bitbucket repository called 'Repo1'.
How should I proceed?
Note - I tried using this guide - https://www.jetbrains.com/help/webstorm/2017.3/set-up-a-git-repository.html?utm_medium=help_link&utm_source=from_product&utm_campaign=WS&utm_content=2017.3#clone-repo
But that guide makes it sound like a a BitBucket repo maps directly to a WebStorm project. In other words, i cannot commit more than one project to a repo.
I got it working. Not sure if this is the right way to do it.
I opened a new WebStorm window (Window 1) and cloned Repo1. I left this window open.
Then, in the filesystem, i copied Project1 directory inside Repo1 directory.
Then, in a new WebStorm window (Window 2), opened Project1 as a project. It prompts me to add Project1 directory as new root, i clicked yes.
Now, when i make changes or add code to Project1, in Window 1 I right click on Project1 -> GIT -> Commit Directory. This saves changes locally.
To push changes to remote repo, in Window 2 i right click on Repo1 -> Git -> Repository -> Push.
Let me know if this workflow for pushing changes makes sense and is the best way to do this.
> But that guide makes it sound like a BitBucket repo maps directly to a WebStorm project. In other words, i cannot commit more than one project to a repo.
Usually, separate projects reside in separate repos. I do not see how the guide makes it look like you can only have one project in a repo though. You can have several projects in one git repo, but it is not the best way, as for me.
As I understand, your Repo1 hosts several projects. That explains the Push rejected error - you were trying to push different git repository (the one you created using Create GIT Repository) to already existing repository, and git found that your local repository does not have commits from the Repo1.
Git repository needs to be handled in whole, you cannot push or pull only its parts. So you did right when cloned Repo1 and added Project1 to the cloned repo. And now, when the Project1 is the part of the repo and can be pushed, you should be able to commit/push from the Window 2. Just make sure it has correct mapping for the repository in Settings - Version control.