Пример #1
0
        public static void Main(string[] args)
        {
            try
            {
                // Specify "true" in VssClientCredentials constructor to use default windows credentials.
                VssConnection connection = new VssConnection(new Uri(collectionUrl), new VssClientCredentials(true));

                // Get a GitHttpClient to use the Git API
                GitHttpClient gitHttpClient = connection.GetClient <GitHttpClient>();

                // TODO: Update yourBranchName
                var branch = gitHttpClient.GetBranchAsync(projectName, repoName, "yourBranchName").Result;
                Console.WriteLine(branch.Name);
            }
            catch (Exception ex)
            {
                Console.WriteLine("{0}: {1}", ex.GetType(), ex.Message);
            }
        }