How to pull a project from Git

Hello to all, forgive me, but I am a beginner and I do not know how to do that.
Please, can someone tell me step by step how to pull a project from bitbucket? I installed the "working" plugin of bitbucket but I can not checkout my project neither from BitBucket nor Git.
6 comments
Comment actions Permalink
You are sure that the repository on bitbucket actually uses git and not mercurial?  And that some files exist in this repository (i.e, it's not empty?)  If it's empty then you will have to follow some slightly different steps to push files up to it first.

https://www.jetbrains.com/pycharm/webhelp/setting-up-a-local-git-repository.html

To check out existing code follow the part in the link above where it says "Clone from a remote git repository."  

If you are at the welcome screen click 'Check out from version control' and select Git.  (If you already have a project open go to the VCS menu then select 'Check out from version control'.)

Then copy the 'Vcs Repository URL' from the URL on the bitbucket page (top right area). If ssh doesn't work for some reason try the HTTPS version of the URL. You must also tell Pycharm where to create the local copy ('Parent Directory') and the name of your working copy ('Directory Name'). The click Clone, and then answer Yes when it asks you whether to open the resulting project.

The repo URL will look something like this:

git@bitbucket.org:USERNAME/project_name.git

or this:

https://USERNAME@bitbucket.org/USERNAME/project_name.git
0
Comment actions Permalink
Thank you for the reply.
The repository is not empty, it contains some files.

I selected Git from 'Check out from version control' and select Git' and I pasted the url of bitbucket. If I test it, the test never ends. If I stop it then it asks me to set a Master Password, what is it? Is it mandatory? I DO NOT want to set any password, since I am not the owner of the repo.
0
Comment actions Permalink
What operating system are you using?

Which form of URL are you using (HTTPS or ssh?) Are you sure the URL is the correct one? Maybe paste it here (change the username and/or project name if you wish) so we can check it.

I think you are having a problem with authentication somehow, which is why I suggested trying both forms.  If you are using ssh make sure your ssh key is set in your bitbucket account. Maybe this will help: https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git

The 'Master Password' is for PyCharm's account/password manager. It's just a purely local password database that saves all your other accounts (bitbucket, github, etc) so that you just have to type the one 'master password' to get access to the saved passwords for your accounts on various services.  It should be optional but then you will have to type the service account password (e.g. bitbucket) every time you push.

You can also try cloning in another program and then opening it in PyCharm. You don't have to use PyCharm to clone the repo. Bitbucket (Atlassian) has their own program SourceTree which isn't bad.  Or just good old:

  $ git clone https://YOUR_USERNAME@bitbucket.org/OWNER_USERNAME/project_name.git
prettyPrint();
0
Comment actions Permalink
I am using Ubuntu 14.04.

I passed the HTTPS URL and now seems to work. The clone dialog has appeared but the process is very slow. I will tell you if I get it.

Eventually in which directory I should run the git command? The Pycharm Project one?
0
Comment actions Permalink
Eventually in which directory I should run the git command? The Pycharm Project one?


If you are referring to the 'git clone' command, yes, you would run it in the directory where you want the project folder to appear. That could be your ~/PycharmWorkspace dir or wherever you want it.  But you don't need to run 'git clone' at the command line if you are doing the cloning from inside PyCharm.  If it's a large project with many revisions it could take a while to clone.

If you clone from the command line (or any other git client) you can just File -> Open the folder in PyCharm.
0
Comment actions Permalink
I really do not understand... after a very long waiting, nothing happened. The dialog disappeared and only the PyCharm entry screen was up. Now I am trying to clone by using the command you suggested.
0

Please sign in to leave a comment.