python - pulling and integrating remote changes with pygit2 -


I have the following problem I am writing a script that searches for a folder for the repository, sees the remote on the net And pulls all the new data into the repository, informs me of new changes. The main idea is clear. I'm using Python 2.7 on Windows 7 X64 using pygit2 to access GIT features. The command line simple command supports "GIT pull 'original' ', but the GIT API is more complex and I do not see the way. Okay, I came away: import pygit2 orepository = pygit2.Repository (" path / to / repository / .git ") oremote = repo.remotes [0] Results = oremote.fetch () This code retrieves new items and downloads it to the repository, but the master branch Does not update or exits new data. Reporter of repository with TortoiseGit By nurturing, I see that nothing was checked in any way, even if the new log message appeared, I did not show the log. I use the git pull command to refresh the repository and copy everything at all. Now my question is: What do I need to do by using pygit2? I mean, I download them by bringing them, but what should I do again? I do the master branch and work Also, I want to update the copy ... Thank you for helping me with my problem. Best Relationship.

Remote.FET () does not update the file because the worker is too far from its job, if you want to update the current branch and want to check those files, then You also need to complete those code, which is Repository.create_reference () or context. Goal = You are on time, and then for example repositories.checkout_head () if you have decided to update.

git-pull is a script that performs many different steps depending on the configuration Pass the flags when you are writing a tool to simulate it on several repositories , Then you need to know what you want to do, everything is just certain that git-pull wins'

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -