コマンドラインを使用して、デフォルトの git osxkeychain 資格情報を定期的に置き換える必要があります。手動で行う方法は次のとおりです。
git credential-osxkeychain erase <Enter>host=github.com <Enter>protocol=https <Enter>password=foo <Enter>username=bar <Enter><Enter><Enter>
そしてgit credential-osxkeychain store、新しい資格情報を除いて、そのプロセスをもう一度行います。私はそれを自動化したいのですが、
alias git_newcred='git credential-osxkeychain erase; host=github.com; protocol=https;git credential-osxkeychain erase; host=github.com; protocol=https;'
;改行がエンターキーの代わりにある場所。しかし、そのままでは黙って失敗します。
read_credentialソース内のメソッドの先頭は次のようになります。
while (fgets(buf, sizeof(buf), stdin)) {
char *v;
if (!strcmp(buf, "\n"))
break;
buf[strlen(buf)-1] = '\0';
単一のコマンドの一部である複数行のエントリをエイリアスするにはどうすればよいですか? または、これを行うより良い方法はありますか?
(zsh を使用していますが、zsh 固有の処理は行われていないと思います。)