code: func (r *Repository) CreateRemote(c *config.RemoteConfig) (*Remote, error) {
  	if err := c.Validate(); err != nil {
  		return nil, err
  	}
  
  	remote := newRemote(r.Storer, c)
  
  	cfg, err := r.Storer.Config()
  	if err != nil {
  		return nil, err
  	}
  
  	if _, ok := cfg.Remotes[c.Name]; ok {
  		return nil, ErrRemoteExists
  	}
  
  	cfg.Remotes[c.Name] = c
  	return remote, r.Storer.SetConfig(cfg)
  }
docs: // CreateRemote creates a new remote