code: func (g *Git) InitConfig(ctx context.Context, userName, userEmail string) error {
  	if userName == "" || userEmail == "" || !strings.Contains(userEmail, "@") {
  		return fmt.Errorf("username and email must not be empty and valid")
  	}
  	// set commit identity
  	if err := g.ConfigSet(ctx, "user.name", userName); err != nil {
  		return errors.Wrapf(err, "failed to set git config user.name")
  	}
  	if err := g.ConfigSet(ctx, "user.email", userEmail); err != nil {
  		return errors.Wrapf(err, "failed to set git config user.email")
  	}
  
  	// ensure sane git config
  	if err := g.fixConfig(ctx); err != nil {
  		return errors.Wrapf(err, "failed to fix git config")
  	}
  
  	if err := ioutil.WriteFile(filepath.Join(g.path, ".gitattributes"), []byte("*.gpg diff=gpg\n"), fileMode); err != nil {
  		return errors.Errorf("Failed to initialize git: %s", err)
  	}
  	if err := g.Add(ctx, g.path+"/.gitattributes"); err != nil {
  		out.Yellow(ctx, "Warning: Failed to add .gitattributes to git")
  	}
  	if err := g.Commit(ctx, "Configure git repository for gpg file diff."); err != nil {
  		out.Yellow(ctx, "Warning: Failed to commit .gitattributes to git")
  	}
  
  	return nil
  }
docs: // InitConfig initialized and preparse the git config