Sourcetreeでコミットした内容を、Bitbucketのリモートリポジトリにプッシュ。

すると、Bitbucketのパスワードを要求されました。

久しぶりにBitbucketを使ったので、パスワードはうろ覚え。
当てずっぽうで入れたら、案の定アウトでした。
次のエラーが出たのです。
git –no-optional-locks -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v –tags origin refs/heads/master:refs/heads/master
Pushing to https://user1@bitbucket.org/user1/file1.git
remote: Invalid username or password
fatal: Authentication failed for ‘https://bitbucket.org/user1/file1.git/’
Pushing to https://user1@bitbucket.org/user1/file1.git
remote: Invalid username or password
fatal: Authentication failed for ‘https://bitbucket.org/user1/file1.git/’
Pushing to https://user1@bitbucket.org/user1/file1.git
remote: Invalid username or password
fatal: Authentication failed for ‘https://bitbucket.org/user1/file1.git/’
Pushing to https://user1@bitbucket.org/user1/file1.git
remote: Invalid username or password
fatal: Authentication failed for ‘https://bitbucket.org/user1/file1.git/’
Completed with errors, see above

どうやら、パスワードを間違えたようですね。
「はあ、やっちまったぁ。まぁ次のパスワードあってればいけるっしょ」
ともう一回プッシュしてみたいところ、
パスワードをきいてくれなくなりました。
しかも、プッシュしたらエラーが必ず出て、ニッチもサッチもいかないではありませんか。
パスワードを間違えたせいでプッシュできずに老後を迎えそうです。
困り果ててググったところ、こちらの神ページに遭遇。
解決策はいたって簡単でした。
どうやら「あるファイル」を削除すればいいようでした。
それはズバリ、
~/Library/Application Support/Sourcetree
にある
<ユーザー名>@STAuth-bitbucket.com
ですね。
チェックしてみたら本当にそのファイルがいました。

今回、ぼくはBitbucketを使いましたが、GitHubをお使いの方は、
<ユーザー名>@STAuth-github.com
というファイル名になるでしょう。
こいつを削除してもう一度Sourcetreeでプッシュ。
そしたら、再びパスワードを聞いてくれたのです。
今回、正しくパスワードをちゃんと入力したら、なんとかプッシュできました。
めでたしめでたしです!

おそらく、ブロガー。現在ホテル暮らしで全国フラフラしています。
ネット広告代理店に1年3ヶ月勤め上げ、独立をして丸4年が経ちました。今年でフリーランス 5年目。
質問・ご意見・相談があればLINEで受け付けていますのでお気軽にどうぞ 。
コメントを残す