git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How can I append authentication with "git push" ?
@ 2012-07-12  8:18 J. Bakshi
  2012-07-12  9:40 ` Jeff King
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: J. Bakshi @ 2012-07-12  8:18 UTC (permalink / raw)
  To: git


Dear list,

Is there any option to add user-name and password with git push ?
Or any repo wise configuration file where I can save the info, so that
it doesn't ask the credential before every push ?

Thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I append authentication with "git push" ?
  2012-07-12  8:18 How can I append authentication with "git push" ? J. Bakshi
@ 2012-07-12  9:40 ` Jeff King
  2012-07-12 15:04 ` Thiago Farina
  2012-07-16  8:25 ` J. Bakshi
  2 siblings, 0 replies; 7+ messages in thread
From: Jeff King @ 2012-07-12  9:40 UTC (permalink / raw)
  To: J. Bakshi; +Cc: git

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I append authentication with "git push" ?
  2012-07-12  8:18 How can I append authentication with "git push" ? J. Bakshi
  2012-07-12  9:40 ` Jeff King
@ 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
  2 siblings, 2 replies; 7+ messages in thread
From: Thiago Farina @ 2012-07-12 15:04 UTC (permalink / raw)
  To: J. Bakshi; +Cc: git

On Thu, Jul 12, 2012 at 5:18 AM, J. Bakshi
<joydeep.bakshi@infoservices.in> wrote:
> Or any repo wise configuration file where I can save the info, so that
> it doesn't ask the credential before every push ?
>
I'd like to know how to do that too.

It's a pain to have to type username and password every time I need to
push to github. (Linux here btw).

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I append authentication with "git push" ?
  2012-07-12 15:04 ` Thiago Farina
@ 2012-07-12 15:30   ` Nick Douma
  2012-07-12 17:22   ` Junio C Hamano
  1 sibling, 0 replies; 7+ messages in thread
From: Nick Douma @ 2012-07-12 15:30 UTC (permalink / raw)
  To: Thiago Farina; +Cc: J. Bakshi, git

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

Hi,

On 12-07-12 17:04, Thiago Farina wrote:
> On Thu, Jul 12, 2012 at 5:18 AM, J. Bakshi
> <joydeep.bakshi@infoservices.in> wrote:
>> Or any repo wise configuration file where I can save the info, so that
>> it doesn't ask the credential before every push ?
>>
> I'd like to know how to do that too.
> 
> It's a pain to have to type username and password every time I need to
> push to github. (Linux here btw).

If you're specifically looking at GitHub and HTTP auth, take a look at
the hub tool:

https://github.com/defunkt/hub

Kind regards,

Nick Douma


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I append authentication with "git push" ?
  2012-07-12 15:04 ` Thiago Farina
  2012-07-12 15:30   ` Nick Douma
@ 2012-07-12 17:22   ` Junio C Hamano
  1 sibling, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2012-07-12 17:22 UTC (permalink / raw)
  To: Thiago Farina; +Cc: J. Bakshi, git

Thiago Farina <tfransosi@gmail.com> writes:

> On Thu, Jul 12, 2012 at 5:18 AM, J. Bakshi
> <joydeep.bakshi@infoservices.in> wrote:
>> Or any repo wise configuration file where I can save the info, so that
>> it doesn't ask the credential before every push ?
>>
> I'd like to know how to do that too.
>
> It's a pain to have to type username and password every time I need to
> push to github. (Linux here btw).

I never type either when pushing to github, and I've been pushing
there at least twice a day for quite some time (Linux here btw).

I have these in .git/config:

        [remote "github2"]
                url = https://github.com/git/git
                fetch = +refs/heads/*:refs/remotes/github2/*
                pushurl = github.com:git/git.git
                push = refs/heads/maint:refs/heads/maint
                push = refs/heads/master:refs/heads/master
                push = refs/heads/next:refs/heads/next
                push = +refs/heads/pu:refs/heads/pu

        [remote "github"]
                url = https://github.com/gitster/git
                pushurl = github.com:gitster/git.git
                mirror

and then this in $HOME/.ssh/config:

        Host github.com
                User git
                IdentityFile ~/.ssh/github

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I append authentication with "git push" ?
  2012-07-12  8:18 How can I append authentication with "git push" ? J. Bakshi
  2012-07-12  9:40 ` Jeff King
  2012-07-12 15:04 ` Thiago Farina
@ 2012-07-16  8:25 ` J. Bakshi
  2012-07-16 11:11   ` Jeff King
  2 siblings, 1 reply; 7+ messages in thread
From: J. Bakshi @ 2012-07-16  8:25 UTC (permalink / raw)
  Cc: git


Any idea please ?

On Thu, 12 Jul 2012 13:48:44 +0530
"J. Bakshi" <joydeep.bakshi@infoservices.in> wrote:

> 
> Dear list,
> 
> Is there any option to add user-name and password with git push ?
> Or any repo wise configuration file where I can save the info, so that
> it doesn't ask the credential before every push ?
> 
> Thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How can I append authentication with "git push" ?
  2012-07-16  8:25 ` J. Bakshi
@ 2012-07-16 11:11   ` Jeff King
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff King @ 2012-07-16 11:11 UTC (permalink / raw)
  To: J. Bakshi; +Cc: git

On Mon, Jul 16, 2012 at 01:55:12PM +0530, J. Bakshi wrote:

> Any idea please ?

Did you miss the four responses here:

  http://thread.gmane.org/gmane.comp.version-control.git/201351

?

-Peff

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-07-16 11:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-12  8:18 How can I append authentication with "git push" ? J. Bakshi
2012-07-12  9:40 ` Jeff King
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

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).