Pulling And Integrating Remote Changes With Pygit2
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, notifyin
Solution 1:
Remote.fetch()
does not update the files in the workdir because that's very far from its job. If you want to update the current branch and checkout those files, you need to also perform those steps, via Repository.create_reference()
or Reference.target=
depending on what data you have at the time, and then e.g. Repository.checkout_head()
if you did decide to update.
git-pull
is a script that performs very many different steps depending on the configuration and flags passed. When you're writing a tool to simulate it over multiple repositories, you need to figure out what it is that you want to do, rather than hoping everything is set up just so that git-pull
won't surprise you.
Post a Comment for "Pulling And Integrating Remote Changes With Pygit2"