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.
The git pull command is used to pull a repository. Pull request is a process for a developer to notify team members that they have completed a feature. Once their feature branch is ready, the developer files a pull request via their remote server account.
In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD . More precisely, git pull runs git fetch with the given parameters and calls git merge to merge the retrieved branch heads into the current branch. With --rebase , it runs git rebase instead of git merge.
The git pull command is actually a combination of two other commands, git fetch followed by git merge . In the first stage of operation git pull will execute a git fetch scoped to the local branch that HEAD is pointed at. Once the content is downloaded, git pull will enter a merge workflow.
git pull is a Git command used to update the local version of a repository from a remote. It is one of the four commands that prompts network interaction by Git. By default, git pull does two things. Updates the current local working branch (currently checked out branch)
Update as of April 2014
A convenience method of Pull
has been added to LibGit2Sharp.
repo.Network.Pull(signature, pullOptions);
You can find more basic usages in the test fixtures.
Pull
is indeed the combination of Fetch
and Merge
.
Fetch
is readyMerge
is in progress (as stated by @EdwardThomson)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.
As the complete merge process isn't available yet, there aren't many tests yet. However, MergeFixture.cs
includes some aspects of the merge
There are other related bits in the CommitFixture.cs
as well
Libgit2 also includes some lower level bits to deal with conflicts that have been resolved by the user.
Merge feature is now available in LibGit2Sharp (see pull request #608)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With