源代码树更改现有帐户的密码

我使用 Sourcetree 通过 ssh 拉并推送到一个服务器。源代码树已经记住了密码,但是密码已经更改。我找不到如何通知源代码树的新密码。

基于谷歌搜索,我尝试了以下方法:

  • 在工具 > 选项 > Sourcetree 认证中查找,这里没有列出任何东西。

  • 在控制面板中的 Windows 凭据管理器中查找。这里也没有列出任何与 git/Sourcetree 或相关服务器相关的内容。

我正在使用 Sourcetree 2.0.18.1

更新

我一直在通过选美比赛使用基于密钥的身份验证来规避这个问题。与此同时,Sourcetree 也有更新,我现在使用的是2.3.1,编辑/删除 %LOCALAPPDATA%\Atlassian\SourceTree\passwd文件可以正常工作(2.0.18没有这个文件)。

165182 次浏览

I had to manually clear stored credentials by emptying those files on my Windows:

%LocalAppData%\Atlassian\SourceTree\userhost
%LocalAppData%\Atlassian\SourceTree\passwd

Then restart SourceTree.

Check to see if you are even using the Wincred credential helper git config --global -l This will set it git config --global credential.helper wincred also --system and/or --local

On OS X, if using a company hosted git repo, and you changed the password due to company password expiration policy, you need to go to keychain access, search for sourcetree in there. An application password will apear for SourceTree. Delete it. Next time you try to fetch/push/whatever on your repo, it will ask for pass and will create a new entry in keychain.

Recently I was facing the same issue and this is how I solve it.

Go to: ToolsOptionsAuthentication
You can see your account there.
Clicking on your account it would give you an edit option. From there you can refresh your password.

Current version is 2.7.1

Remove the cache folder from ~\AppData\Local\Atlassian\SourceTree

After that try to pull from your existing repository. It will then ask you for new username and password. Put your changed password. You are done.

You can check your settings from Source Tree after that. Tools>Options> Authentication.

Go to Preferences ▶︎ Advanced menu and delete the hostname that you want to reset.

After this, you can re-enter your username and password whenever needed (such as pulling from git).

I had the same issue and that work for me was:

Go to Windows Credentials Manager and edit my Git credentials.

For Mac given steps can help you...

  1. Got to the folder ~/Library/Application Support/SourceTree
  2. Delete the file {Username}@STAuth-bitbucket.org
  3. Restart Sourcetree
  4. Try to fetch, password filed appear, give your new password
  5. Also can run "git fetch" command in terminal and need to type password
  6. Done

For macOS, go to keychain -> Login. Delete all the keychains stored for bitbucket/github, quit sourcetree, open it again and try to pull the code. It will ask for the new password and it will also store the keychain for updated password in mac keychain.

For me (MAC) goto SourceTree -> preferences. A popup will open. goto Accounts tab, double click on account u want to update password and update password.

For mac, delete bitbucket / git credentials on key-chain item and recreate new item on keychain with name, account and new password details for bit bucket/ git and save keychain item. While reopening source tree it grants access with updated details.

Editing directly on keychain dint work, deleting and recreating them worked.

Found an easier fix: Mac Mojave

  1. Go to your repo folder in terminal
  2. Run: git config --global credential.helper osxkeychain
  3. Git pull
  4. Enter your username and password, then git will pull
  5. Run: git config --global credential.helper store
  6. Run: git config --global credential.helper cache
  7. Do a git pull, it should ask you for creds once

Bingo! Now your password is stored in Git.

PS: Sourcetree is a Wrapper around terminal git, fix the terminal = fix the wrapper.

I used to delete this file as well but in my current version this options is not available anymore.

After searching and trying few things one that worked for me was:

Opened the Windows Credential Manager, then clicked on Windows Credentials option, looked for my git: entry credential and clicking on edit I could update my password.

As of version 4.1.0 the problem that I had is correct credentials but as I have deleted ~/.ssh/known_hosts file then the GitHub fingerprint couldn't be verified, so Source Tree would just hang.

Solved by doing a manual fetch in terminal and accepting GitHub's public RSA key

I have one solution ,

I faced the same problem ,Normally I was used the SourceTreeClient for pushing and pull, commit the code to GitLab account ,one day I reset the password for my GITLAB account ,now i am facing with error,that --->ERROR:

remote: HTTP Basic : Access denied fatal: Authentication failed for 'https:gitlab...'

solution : For windows OS, windows tab -> credential Manager -> windows Credentials -> Generic credentials -> select @.git-lab.com ( related to that source tree account) -> click on remove ->ok

after doing this work while we executing git pull it will ask for the username and password ,then it will execute correctly without showing error,,

In case of Azure-Devops authentication, only removing the cache file from ~\AppData\Local\Atlassian\SourceTree worked for me

I tried to set up the credentials several times but didn't authenticate correctly. So I logged out, removed cache folder, then logge in and it worked.

For Windows - Delete the passwd file located in below path

\AppData\Local\Atlassian\SourceTree

Then authenticate again using Tools -> Options -> Authentication (OAuth or Basic)

Try a push or pull, it will ask for Credentials and save it again, it will create a new passwd file

For Mac user in 2021

You can go to Keychain Access -> Search for github.com Access Key for your_username -> Double click your username -> Show password -> And then you can freely edit it. Sometime it will ask you to enter your password again.

  1. Go to repository overview
  2. Right-click the repository and click Custom Action
  3. Click 'Account' tab
  4. Edit your password