Come è possibile modificare l'URL remoto di un repository?Modifica dell'URL remoto di un repository in libgit2sharp
using (var repository = new Repository(repositoryPath))
{
//Change the remote url first
//Then checkout
}
Come è possibile modificare l'URL remoto di un repository?Modifica dell'URL remoto di un repository in libgit2sharp
using (var repository = new Repository(repositoryPath))
{
//Change the remote url first
//Then checkout
}
Come possiamo modificare l'URL a distanza di un repository?
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);
Per quel che vale, la maggior parte delle proprietà remoti può essere aggiornato seguendo lo stesso schema. Sentitevi liberi di dare un'occhiata alla suite di test RemoteFixture.cs per esempi più dettagliati.
Avevano effettuato pubblico virtuale Aggiornamento remoto (remoto remoto, azioni Action [] param) obsoleto.
var newUrl = "https://github.com/owner/my_repository.git";
WorkingRepository.Network.Remotes.Update("origin", r => { r.Url = uri; });