Как мы можем изменить удаленный URL-адрес репозитория?Изменение удаленного URL-адреса репозитория в libgit2sharp
using (var repository = new Repository(repositoryPath))
{
//Change the remote url first
//Then checkout
}
Как мы можем изменить удаленный URL-адрес репозитория?Изменение удаленного URL-адреса репозитория в libgit2sharp
using (var repository = new Repository(repositoryPath))
{
//Change the remote url first
//Then checkout
}
Как мы можем изменить удаленный URL репозитория?
var newUrl = "https://github.com/owner/my_repository.git";";
Remote remote = repo.Network.Remotes[name];
// This will update the remote configuration, persist it
// and return a new instance of the updated remote
Remote updatedremote = repo.Network.Remotes.Update(remote, r => r.Url = newUrl);
Для чего это стоит, большинство удаленных свойств могут быть обновлены, следуя той же схеме. Не стесняйтесь заглядывать в RemoteFixture.cs набор тестов для более подробных примеров.
Было сделано общедоступное виртуальное удаленное обновление (удаленный пульт, параметры Действие [] действия) устаревшее.
var newUrl = "https://github.com/owner/my_repository.git";
WorkingRepository.Network.Remotes.Update("origin", r => { r.Url = uri; });