echo 'mypass' | git pull git pull < 'mypass' git pull < echo 'mypass'
似乎没有工作.
http://git-scm.com/docs/gitcredentials.html
DESCRIPTION
Git will sometimes need credentials from the user in order to perform operations; for example,it may need to ask for a username and password in order to access a remote repository over HTTP. This manual describes the mechanisms Git uses to request these credentials,as well as some features to avoid inputting these credentials repeatedly.
[…]
REQUESTING CREDENTIALS
Without any credential helpers defined,Git will try the following strategies to ask the user for usernames and passwords:
- If the
GIT_ASKPASS
environment variable is set,the program specified by the variable is invoked. A suitable prompt is provided to the program on the command line,and the user’s input is read from its standard output.- Otherwise,if the
core.askPass
configuration variable is set,its value is used as above.- Otherwise,if the
SSH_ASKPASS
environment variable is set,the user is prompted on the terminal.
[…]
Credential helpers,on the other hand,are external programs from which Git can request both usernames and passwords; they typically interface with secure storage provided by the OS or other programs.
You may also have third-party helpers installed; search for
credential-*
in the output ofgit help -a
,and consult the documentation of individual helpers. Once you have selected a helper,you can tell Git to use it by putting its name into thecredential.helper
variable.
git help -a | grep credential- *显示以下帮助器:
credential remote credential-cache remote-ext credential-cache--daemon remote-fd credential-osxkeychain remote-ftp credential-store remote-ftps