All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miguel Susano Pinto <carandraug@gmail.com>
To: git@vger.kernel.org
Subject: git init with specified user.email
Date: Thu, 08 Jan 2026 17:21:31 +0000	[thread overview]
Message-ID: <875x9cvx44.fsf@word> (raw)

git checkout has a --config option so one can do:

    git clone --config 'user.email=email-for-this-clone' ...

which I find nice to setup as git alias:

    clone-work = clone --config 'user.email=my-work-email'

(while leaving the default clone for my personal projects; or an alias
for clone-personal with the work email as the clone default).

I would like something similar for git init.  However, git init does not
have a `--config` option.  I tried to use

    git -c 'user.email=my-work-email' init

but that's not working (I'm guessing it only picks up configurations
mentioned on the man page for git-init).

I am currently working around this with a template for work but would
prefer to init with `-c` (or similar) or at least understand why this is
not possible.

--
David

             reply	other threads:[~2026-01-08 17:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-08 17:21 David Miguel Susano Pinto [this message]
2026-01-08 23:22 ` git init with specified user.email brian m. carlson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875x9cvx44.fsf@word \
    --to=carandraug@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.