Domanda

I am new on using github but I successfully worked my way committing and pulling some code and then pushing it back to the repository after doing changes. However, When ever I push or pull on github I need to enter my username and password every single time. Is there a way to save these credentials one time and never be asked again? I am using Aptana Studio 3, build: 3.4.1.201306062137 and ubuntu 12.04

È stato utile?

Soluzione

First you need to tell git your name, so that it can properly label the commits you make.

$git config --global user.name "Your Name Here"
# Sets the default name for git to use when you commit

Git saves your email address into the commits you make. We use the email address to associate your commits with your GitHub account.

$git config --global user.email "your_email@example.com"
# Sets the default email for git to use when you commit

Your email address for Git should be the same one associated with your GitHub account.

The last option we need to set will tell git that you don't want to type your username and password every time you talk to a remote server.

$git credential-osxkeychain
# Test for the cred helper
# Usage: git credential-osxkeychain <get|store|erase>

To tell git to use osxkeychain, simply set the global git config:

$git config --global credential.helper osxkeychain
# Set git to use the osxkeychain credential helper

The next time you clone an HTTPS URL that requires a password you will be prompted for your username and password, and to grant access to the OSX keychain. After you've done this, the username and password are stored in your keychain and you won't be required to type them in to git again.

Hope this helps :/

Altri suggerimenti

This will do the job on linux:

$ git config credential.helper store
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top