无法从 Sourcetree 毫无错误地推送到 Bitbucket
Unable to push to Bitbucket from Sourcetree without Error
多年来我一直在使用 Sourcetree 和 Bitbucket。最近事情发生了变化,我有点迷路了。我收到这条消息
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags the_repo refs/heads/file_system:refs/heads/file_system
Pushing to https://BLAH@bitbucket.org/BLAH/the_repo.git
remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.
fatal: Authentication failed for 'https://BLAH@bitbucket.org/BLAH/the_repo.git/'
Pushing to https://BLAH@bitbucket.org/BLAH/the_repo.git
POST git-receive-pack (549 bytes)
remote:
remote: Create pull request for file_system:
remote: https://bitbucket.org/BLAH/the_repo/pull-requests/new?source=file_system&t=1
remote:
To https://bitbucket.org/BLAH/the_repo.git
= [up to date] The_Repo-Release-Version-123 -> The_Repo-Release-Version-123
27a5475..71431a7 file_system -> file_system
updating local tracking ref 'refs/remotes/The_Repo/file_system'
Completed successfully
但是尽管有错误,推送似乎确实在发生。我想我会更好地处理我进入 Bitbucket.org 并寻找要设置的密码的错误情况。我在 Bitbucket 中为我的存储库设置了一个应用程序密码,以允许两步验证(设置正确吗?)。根据 Bitbucket 页面
App passwords allow two-step verification users to access their
Bitbucket account through apps such as SourceTree.
我不确定这是否是第一条消息的意思,但这是我能找到的唯一相关的地方。然而,事情并没有改变。 'push' 似乎需要更长的时间,但仍然会通过。我收到一条相同的消息,包括错误和 'completed successfully'。谁能告诉我如何修复 "Invalid username or password" 错误,也许我应该把密码放在 Bitbucket 和 Sourcetree 中的什么地方?也许问题在于我正在使用 Sourcetree,这只会让我的生活复杂化。您是否建议我只学习命令行并从那里处理推送?
要在 Sourcetree 中输入您新创建的 App 密码,请执行以下操作:
- 转到
Preferences -> Accounts
- 双击您的 Bitbucket 帐户
- 点击
Set Password
创建本地存储库后:
- 点击右上角的图标"settings"然后创建远程分支"master"
- 创建此分支后..您将能够推送。
我认为这是 Sourcetree 中的新功能。我以前从来没有这样做过。我花了 2 天时间才找到答案。
我的版本:SourceTree 版本 2.3.5.0
多年来我一直在使用 Sourcetree 和 Bitbucket。最近事情发生了变化,我有点迷路了。我收到这条消息
git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags the_repo refs/heads/file_system:refs/heads/file_system
Pushing to https://BLAH@bitbucket.org/BLAH/the_repo.git
remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.
fatal: Authentication failed for 'https://BLAH@bitbucket.org/BLAH/the_repo.git/'
Pushing to https://BLAH@bitbucket.org/BLAH/the_repo.git
POST git-receive-pack (549 bytes)
remote:
remote: Create pull request for file_system:
remote: https://bitbucket.org/BLAH/the_repo/pull-requests/new?source=file_system&t=1
remote:
To https://bitbucket.org/BLAH/the_repo.git
= [up to date] The_Repo-Release-Version-123 -> The_Repo-Release-Version-123
27a5475..71431a7 file_system -> file_system
updating local tracking ref 'refs/remotes/The_Repo/file_system'
Completed successfully
但是尽管有错误,推送似乎确实在发生。我想我会更好地处理我进入 Bitbucket.org 并寻找要设置的密码的错误情况。我在 Bitbucket 中为我的存储库设置了一个应用程序密码,以允许两步验证(设置正确吗?)。根据 Bitbucket 页面
App passwords allow two-step verification users to access their Bitbucket account through apps such as SourceTree.
我不确定这是否是第一条消息的意思,但这是我能找到的唯一相关的地方。然而,事情并没有改变。 'push' 似乎需要更长的时间,但仍然会通过。我收到一条相同的消息,包括错误和 'completed successfully'。谁能告诉我如何修复 "Invalid username or password" 错误,也许我应该把密码放在 Bitbucket 和 Sourcetree 中的什么地方?也许问题在于我正在使用 Sourcetree,这只会让我的生活复杂化。您是否建议我只学习命令行并从那里处理推送?
要在 Sourcetree 中输入您新创建的 App 密码,请执行以下操作:
- 转到
Preferences -> Accounts
- 双击您的 Bitbucket 帐户
- 点击
Set Password
创建本地存储库后:
- 点击右上角的图标"settings"然后创建远程分支"master"
- 创建此分支后..您将能够推送。
我认为这是 Sourcetree 中的新功能。我以前从来没有这样做过。我花了 2 天时间才找到答案。
我的版本:SourceTree 版本 2.3.5.0