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
threads / discuss / 31006
Subject: How can I append authentication with "git push" ?
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
Re: How can I append authentication with "git push" ?
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
Re: How can I append authentication with "git push" ?
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).
Re: How can I append authentication with "git push" ?
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
Re: How can I append authentication with "git push" ?
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
mirrorand then this in $HOME/.ssh/config:
Host github.com
User git
IdentityFile ~/.ssh/githubRe: How can I append authentication with "git push" ?
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
Re: How can I append authentication with "git push" ?
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