我们如何更改存储库的远程URL?
using (var repository = new Repository(repositoryPath))
{
//Change the remote url first
//Then checkout
}
Run Code Online (Sandbox Code Playgroud)
我们如何更改存储库的远程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);
Run Code Online (Sandbox Code Playgroud)
对于它的价值,可以通过遵循相同的模式来更新大多数远程属性.请随时查看RemoteFixture.cs测试套件以获取更详细的示例.
| 归档时间: |
|
| 查看次数: |
1369 次 |
| 最近记录: |