pygit2

How to make a git merge by pygit2

£可爱£侵袭症+ 提交于 2019-12-01 12:45:39
问题 I try to merge branch into master: repo = pygit2.Repository("/path/to/repo/") branch = repo.lookup_branch("upstream/branch", pygit2.GIT_BRANCH_REMOTE) oid = branch.target merge_result = repo.merge(oid) And merge_result contains ff oid (as in documentaion) and repo hasn't changed. What should I do next to change the repository? 回答1: The merge function does the merge (or in this case tells you you could skip it), but it's up to you (or the user of the tool) whether you want to move the current

pulling and integrating remote changes with pygit2

佐手、 提交于 2019-11-29 15:47:26
I do have the following problem. I'm writing a script which searches a folder for repositories, looks up the remotes on the net and pulls all new data into the repository, notifying me about new changes. The main idea is clear. I'm using python 2.7 on Windows 7 x64, using pygit2 to access the git features. The command-line supports the simple command "git pull 'origin'", but the git api is more complicated and I don't see the way. Okay, I came that far: import pygit2 orepository=pygit2.Repository("path/to/repository/.git") oremote=repo.remotes[0] result=oremote.fetch() This code retrieves the

pulling and integrating remote changes with pygit2

[亡魂溺海] 提交于 2019-11-28 09:46:25
问题 I do have the following problem. I'm writing a script which searches a folder for repositories, looks up the remotes on the net and pulls all new data into the repository, notifying me about new changes. The main idea is clear. I'm using python 2.7 on Windows 7 x64, using pygit2 to access the git features. The command-line supports the simple command "git pull 'origin'", but the git api is more complicated and I don't see the way. Okay, I came that far: import pygit2 orepository=pygit2