code: func Init(ctx context.Context, path string) (*Git, error) {
  	g := &Git{
  		path: path,
  	}
  
  	if !g.IsInitialized() {
  		r, err := git.PlainInit(path, false)
  		if err != nil {
  			return nil, errors.Wrapf(err, "Failed to initialize git: %s", err)
  		}
  		g.repo = r
  		wt, err := g.repo.Worktree()
  		if err != nil {
  			return nil, errors.Wrapf(err, "Failed to get worktree: %s", err)
  		}
  		g.wt = wt
  	}
  
  	if !ctxutil.IsGitInit(ctx) {
  		return g, nil
  	}
  
  	// add current content of the store
  	if err := g.Add(ctx, g.path); err != nil {
  		return g, errors.Wrapf(err, "failed to add '%s' to git", g.path)
  	}
  
  	// commit if there is something to commit
  	if !g.HasStagedChanges(ctx) {
  		out.Debug(ctx, "No staged changes")
  		return g, nil
  	}
  
  	if err := g.Commit(ctx, "Add current content of password store"); err != nil {
  		return nil, errors.Wrapf(err, "failed to commit changes to git")
  	}
  
  	return g, nil
  }
docs: // Init creates a new git repo on disk