C
C
Chemoday2016-07-22 16:58:37
Python
Chemoday, 2016-07-22 16:58:37

What method to work with github to use?

I'm going to write something like a small CI system, I thought everything through, but the problem arose at the very initial stage - working with Github
. The easiest way to write such a program working in python:
1. Connecting to github
2. Checking the last commit in the master branch (is there difference )
3. If something was committed, then download only the difference in the files.
I tried to use libraries like GitPython, dulwich, gittle (it was not installed under Windows), but they didn’t bring me much success, maybe I just need to understand it better.
Of course, I can implement the "stupid" method of checking and downloading - the entire project will be downloaded through the API, but I absolutely do not like this method
I have no experience with git, so I'm asking for help here, because perhaps knowledgeable people will tell you how this can be done the easiest way?
What handy tools do you use?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Nikolaev, 2016-07-22
@Chemoday

Here's for Google:
subprocess, git pull, git status, git log
I'm not even too lazy to write this "program" for you:

import subprocess
subprocess.call('git pull', shell=True, cwd='.')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question