2015-05-15 9 views

risposta

5

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.

0

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; }); 
Problemi correlati