Navigate to the directory you'd like this repository to live in.
Type "git clone ", then paste the URL you copied from Bitbucket into the console (use Ctrl+v) and hit "Enter".
Give it your Bitbucket password when it asks for it.
(Optional:) To set up SSH access:
From a PythonAnywhere bash console, run 'ssh-keygen'.
You can hit just hit enter for all of the options it presents you (i.e. the path to the file and the password).
Do a 'cat' on the id_rsa.pub file it creates to display the contents of the file.
Copy the contents of the id_rsa.pub file and add a new SSH key entry for your Bitbucket account, name it 'PythonAnywhere', and paste in the contents of the id_rsa.pub file.
If you did a 'git clone' and used a URL that begins with 'https', you need to change the URL to start with 'ssh' instead, otherwise it won't use your SSH key and will instead prompt you for your password:
Go to File → Settings → Tools → Terminal → 'Shell path' and add '/K "path/to/activate.bat"' (with quotation marks around the path) after the "cmd.exe". Have "cmd.exe" in quotation marks as well. (Source 1, Source 2)
Click "OK" to save your changes.
Start a Terminal session.
You should see the name of your virtualenv in parentheses on the command line. Running 'python' should start the version of python that you set earlier.
Create a 'requirements.txt' file in PyCharm.
We're doing this so that we can have our (not-yet-created) PythonAnywhere virtualenv download the necessary packages.
Step-by-step instructions: (You can find official instructions here.)
Start a Terminal session and run 'pip freeze > requirements.txt'. (Source)
(As you can see in the screenshot, it may prompt you to upgrade pip first.)
If you run into an error while upgrading, try running "easy_install -U pip".
The 'requirements.txt' file should appear in the pane on the left.
If you're creating a brand-new project, this file will probably be empty.
If you're setting up a project after you've already written some code that uses certain packages, you should see a list of those packages and their versions.
Use SourceTree to push new files to the Bitbucket repository.
If you switch back to SourceTree you should see a list of files that SourceTree has noticed as being new.
Ignore the '.idea/' folder and the 'venv' folder.
We don't want to have our PyCharm files in the git repository (I think), so navigate to 'Actions' → 'Ignore'
Select 'Ignore everything beneath: .idea'
Once that's done those '.idea' files should disappear from the list of Unstaged files.