I'm trying to merge changes from the remote branch into the local repository, however I've been unable to get this to work properly -- likely misunderstanding of the implementation. Fetching seems to work fine, as I can see the updates on the server, but I think I'm breaking something when attempting to pull.
I've tried:
repo.Checkout( branch.TrackedBranch, CheckoutOptions.None, OnCheckoutProgress );
This seems to do what you would expect from a Clone call. I can also not find a method to merge. As I've read, git pull
is just like calling a fetch, then a merge.
I've looked at some of the tests in the repo, such as the MergeFixture, but it didn't seem to be what I was hoping it would be.
Pull
is indeed the combination ofFetch
andMerge
.Fetch
is readyMerge
is in progress (as stated by @EdwardThomson)As the complete merge process isn't available yet, there aren't many tests yet. However,
MergeFixture.cs
includes some aspects of the mergeThere are other related bits in the
CommitFixture.cs
as wellLibgit2 also includes some lower level bits to deal with conflicts that have been resolved by the user.
Update
Merge feature is now available in LibGit2Sharp (see pull request #608)
Update as of April 2014
A convenience method of
Pull
has been added to LibGit2Sharp.You can find more basic usages in the test fixtures.