Github and PyCharm

I am not a programmer but sometimes I create some small API integration for HyperFlex that make my life easier. I am writing in Python and I am using PyCharm with the plugin Kite. To have my code published and make sure the correct versions are on the web, I am using the PyCharm Github integration. This blog is a reminder for myself how I setup everything and it’s working smoothly.

Settings in PyCharm for Github

Before pushing the files, you must use the local VCS. Select VCS Operation Popup.

PyCharm VCS

Create Git Repository

And select the directory.

When this is enabled for your project, you will see at the bottom GIT and if you click this, the most important thing is the green check marker. When you hit this, the changes will be locally pushed.

 

You must select the files you want to be in the Version Control. I am using a virtual python environment and I don’t want to have those files published.

If you fill in the Author and you get some error messages, leave the Author field empty. This is working for me.

In the Commit Message, just do a brief description so when you are working with a team to the code, it’s easier to see what is changed.

Click commit and the files are locally committed.

 

So the files are NOT on github yet. You must PUSH them to Github.

Push to Github

But there is no Remote destination defined yet.

Pushed to Github

Lets solve this:

Before the code can be pushed to Github, a new Repositry should be created online:

Github create repository

Now a new repository is created and it is set to be public.

Copy the Github url

And paste the link in PyCharm : Define Remote.

Push the files to Github:

 

Right now PyCharm is pushing all files.

 

When the code is pushed to Github, you will see something like :

Pushed to Github

 

Pushed to Github

You can verify the files on your Github directory online.

As you can see, there was no README.MD file yet. So I created on in PyCharm and now you can Add this file to the files that will be pushed to Github.

Pushed to Github

 

Just as a reminder: You can find my HyperFlex Python scripts at : github.com/iamjoost

 

Leave a Reply