-
Notifications
You must be signed in to change notification settings - Fork 889
git pull
kobake edited this page Aug 12, 2018
·
4 revisions
$ git pull
using (var repo = new Repository("path/to/your/repo"))
{
// Credential information to fetch
LibGit2Sharp.PullOptions options = new LibGit2Sharp.PullOptions();
options.FetchOptions = new FetchOptions();
options.FetchOptions.CredentialsProvider = new CredentialsHandler(
(url, usernameFromUrl, types) =>
new UsernamePasswordCredentials()
{
Username = USERNAME,
Password = PASSWORD
});
// User information to create a merge commit
var signature = new LibGit2Sharp.Signature(
new Identity("MERGE_USER_NAME", "MERGE_USER_EMAIL"), DateTimeOffset.Now);
// Pull
Commands.Pull(repo, signature, options);
}