8

I know this question has been asked before and I've been looking at this link :

https://www.kernel.org/pub/software/scm/git/docs/git-credential-store.html

I'm really really new to using Git Gui Application for Windows and Git Hub in general.

I've "fetched" an existing repository by typing in the URL for the repository from the Git Hub website in the format https://github.com/projectname.git

To push to it, I copy paste files into my local git directory and then hit f5 in Git Gui and commit/push to the origin.

However each time I want to push something - it asks me for my username and password. The guide says to create a text file named .git-credentials with your username and password in the given format:

https://user:pass@example.com

Question:

How do I link the usage of the .git-credentials file with my Git Gui Application?...Am I using DOS? Or some Git Shell from somewhere?...

Any help would be greatly appreciated...

shecodesthings
  • 1,218
  • 2
  • 15
  • 33

1 Answers1

7

One solution is to use the GitHub for Windows application: it will store your credentials for you, as mentioned in this GitHub help page.

But it also adds:

If you don't want to use GitHub for Windows, you can download the helper for your OS here:

Windows Vista, 7, & 8 (.NET 4.0 required)

Unzip the file and run the git-credential-winstore.exe program inside. This will start up the helper and update your git config to use it.

Tip: The credential helper only works when you clone an HTTPS repository URL. If you use the SSH repository URL instead, SSH keys are used for authentication.

So you don't need to create yourself a .git-credentials file: the git-credential-winstore.exe program will guide you through it.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Hi VonC, 'If you don't want to use GitHub for Windows, you can download the helper for your OS here:', can you add a download link? – shecodesthings Jun 03 '13 at 16:49
  • 1
    Hi, thanks for the quick reply! It installs and asks if I want to prompt for passwords. When I hit yes, it says it cant find git. So I use the following command git-credential-winstore -i "C:/Program Files (x86)/Git/bin/git" but then it still crashes and gives me: The system cannot find the file specified... – shecodesthings Jun 03 '13 at 17:00
  • @AminaKhalique shouldn't that be `-i "C:/Program Files (x86)/Git/bin/git.exe"`? – VonC Jun 03 '13 at 17:01
  • Whoops! Okay so I changed it to use -i "C:/Program Files (x86)/Git/bin/git.exe" (forgot the damn space after Files). Command seems to work and then nothing happens. If I run git-credential-winstore again it asks for the path information again and doesn't start the helper... – shecodesthings Jun 03 '13 at 17:05
  • @AminaKhalique it will: the first `git push` will ask for your credentials, but the second `git push` won't, because the credential help will have those memorized. – VonC Jun 03 '13 at 17:45
  • Thanks VonC! You were very helpful! – shecodesthings Jun 03 '13 at 18:44
  • Honestly the Helper app is a fantastic. I dont know why it isnt part of the package (probably a licensing thing – Narrim Nov 28 '13 at 23:24
  • @Narrim Nowadays, I much prefer using gpg-encrypted `_netrc` file, instead of a memory cache credential helper: I don't have to re-enter all those passwords each days. See http://stackoverflow.com/a/18362082/6309 – VonC Nov 29 '13 at 06:31