Skip to content

Instantly share code, notes, and snippets.

@tsu-nera
Created May 25, 2013 12:40
Show Gist options
  • Select an option

  • Save tsu-nera/5648942 to your computer and use it in GitHub Desktop.

Select an option

Save tsu-nera/5648942 to your computer and use it in GitHub Desktop.
Cygwinでのgit pushでパスワード省略
#!/usr/bin/zsh
# ログイン情報
username=tsu-nera
password=************
# expect コマンドを実行
expect -c "
# タイムアウト値の指定
set timeout 20
spawn git push
# login
expect \"Username for \'https://github.com\':\"
send \"$username\n\"
expect \"Password for \'https://$username@github.com\':\"
send \"$password\n\"
interact
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment