MCPcopy
hub / github.com/go-git/go-git / Remotes

Method Remotes

repository.go:619–634  ·  view source on GitHub ↗

Remotes returns a list with all the remotes

()

Source from the content-addressed store, hash-verified

617
618// Remotes returns a list with all the remotes
619func (r *Repository) Remotes() ([]*Remote, error) {
620 cfg, err := r.Config()
621 if err != nil {
622 return nil, err
623 }
624
625 remotes := make([]*Remote, len(cfg.Remotes))
626
627 var i int
628 for _, c := range cfg.Remotes {
629 remotes[i] = NewRemote(r.Storer, c)
630 i++
631 }
632
633 return remotes, nil
634}
635
636// CreateRemote creates a new remote
637func (r *Repository) CreateRemote(c *config.RemoteConfig) (*Remote, error) {

Calls 2

ConfigMethod · 0.95
NewRemoteFunction · 0.85