From: Jeff King <peff@peff.net>
To: "J. Bakshi" <joydeep.bakshi@infoservices.in>
Cc: git@vger.kernel.org
Subject: Re: How can I append authentication with "git push" ?
Date: Thu, 12 Jul 2012 05:40:40 -0400 [thread overview]
Message-ID: <20120712094040.GA5268@sigill.intra.peff.net> (raw)
In-Reply-To: <20120712134844.2d1c4378@shiva.selfip.org>
On Thu, Jul 12, 2012 at 01:48:44PM +0530, J. Bakshi wrote:
> Is there any option to add user-name and password with git push ?
The username can go in the URL. For example:
git push user@host:repo.git
for ssh, or:
git push https://user@host/repo.git
for http.
For ssh, you can't specify a password automatically, but you should look
into using key authentication (which can then be cached by ssh-agent).
For http, you can put the password in the URL, but there are some
security implications (like the fact that your password will be
cleartext on disk, and visible in the process list to other users on the
system).
What protocol are you using to push?
> Or any repo wise configuration file where I can save the info, so that
> it doesn't ask the credential before every push ?
Older versions of git can read from .netrc, but I would not recommend
that, as it involves storing the password in plaintext on disk.
Newer versions of git (v1.7.9 and up) support "credential helpers" which
will read from a password wallet or other secure storage provided by the
OS. There is a helper for OS X Keychain in contrib/, and somebody has
been working on one for Windows. What platform are you using?
-Peff
next prev parent reply other threads:[~2012-07-12 9:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 8:18 How can I append authentication with "git push" ? J. Bakshi
2012-07-12 9:40 ` Jeff King [this message]
2012-07-12 15:04 ` Thiago Farina
2012-07-12 15:30 ` Nick Douma
2012-07-12 17:22 ` Junio C Hamano
2012-07-16 8:25 ` J. Bakshi
2012-07-16 11:11 ` Jeff King
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=20120712094040.GA5268@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=joydeep.bakshi@infoservices.in \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).