Skip to content
kobake edited this page Aug 12, 2018 · 4 revisions

git-pull

Pulls updates from a remote using Authentication

Git

$ git pull 

LibGit2Sharp

using(varrepo=newRepository("path/to/your/repo")){// Credential information to fetchLibGit2Sharp.PullOptionsoptions=newLibGit2Sharp.PullOptions();options.FetchOptions=newFetchOptions();options.FetchOptions.CredentialsProvider=newCredentialsHandler((url,usernameFromUrl,types)=>newUsernamePasswordCredentials(){Username=USERNAME,Password=PASSWORD});// User information to create a merge commitvarsignature=newLibGit2Sharp.Signature(newIdentity("MERGE_USER_NAME","MERGE_USER_EMAIL"),DateTimeOffset.Now);// PullCommands.Pull(repo,signature,options);}

Clone this wiki locally