Skip to content

Instantly share code, notes, and snippets.

@MoLow
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save MoLow/87f4f46df37d9a137824 to your computer and use it in GitHub Desktop.

Select an option

Save MoLow/87f4f46df37d9a137824 to your computer and use it in GitHub Desktop.
Git auto input username & password for ssh
C:\> git config --global core.askpass C:\<path>\git-gui--askpass
C:\<path>\git-gui--askpas:
#!/bin/sh
# Tcl ignores the next line -*- tcl -*- \
exec wish "$0" -- "$@"
set answer ""
set prompt [join $argv " "]
if {[regexp -nocase {(username)(\w*)} $prompt]} {
set answer "<Set Username>"
}
if {[regexp -nocase {(password)(\w*)} $prompt]} {
set answer "<set passwod>"
}
puts $answer
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment