Page 1 of 1

[SOLVED] Too hard to push to GIThub

Posted: Wed Jun 08, 2016 3:10 pm
by Octal450
Hi, I sometimes need to push alot of bulk updates, and its too hard. I have to do:

git add .

git commit -m "blablabla"

git push origin master

type username

type password

git push origin2 master

type username

type password


Way to long for each plane! Especially since my password is longer than 30 characters. I have to update sometimes 6 or 7 at once. Not all have an origin2, but most do. Can I get rid of the passwords, and have Git remember them like gitlab uses?

Re: To hard to push to GIThub

Posted: Wed Jun 08, 2016 3:13 pm
by IAHM-COL
https://help.github.com/articles/genera ... ssh-agent/

Get a ssh key. Upload the pubkey to github

https://help.github.com/articles/adding ... b-account/

And clone using ssh, instead of https:

Then you don't need to type passwords to push

Re: To hard to push to GIThub

Posted: Wed Jun 08, 2016 4:21 pm
by Octal450
OK, and how do I clone with ssh?

Re: To hard to push to GIThub

Posted: Wed Jun 08, 2016 4:30 pm
by IAHM-COL
Image

Click on "USE SSH" for the proper url

then, example

1. you had not cloned yet

Code: Select all

git clone git@github.com:FGMEMBERS/GulfstreamG550.git

Notice above how git@ is used instead of http://

2. you already cloned

Code: Select all

git remote -v

Response will show you origin pointing to a http:// url

example

Code: Select all

git remote remove origin
git remote add orgin git@github.com:FGMEMBERS/GulfstreamG550.git
git remote -v

Response will show you your origin now points to a ssh git@ url

Re: To hard to push to GIThub

Posted: Wed Jun 08, 2016 4:53 pm
by OPFOR77
Instead of SSH...

You can use

Code: Select all

git config --global credential.helper "cache --timeout=3600"


And you won't have to retype your password for an hour. This is what I use on linux.

Or you can use the netrc file. See this link. Would be different instructions if not on Windows.

Re: To hard to push to GIThub

Posted: Wed Jun 08, 2016 6:32 pm
by Octal450
Thx, won't have to reclone that way, let me try. I used 36000, to make the time longer ;)

Re: To hard to push to GIThub

Posted: Wed Jun 08, 2016 9:11 pm
by Octal450
git: 'credential-cache' is not a git command. See 'git --help'.

Not working

Re: To hard to push to GIThub

Posted: Wed Jun 08, 2016 11:00 pm
by OPFOR77
Try typing it again. That error tells me you entered the wrong command.

For other techniques, see: https://git-scm.com/docs/git-credential-store

Re: [SOLVED] Too hard to push to GIThub

Posted: Sun Jun 12, 2016 9:29 pm
by Octal450
that never ended up working, Israel and I switched to SSH.