github, sourcetree getting unauthorized error
To work with GitHub's two-factor authentication in SourceTree you can simply use your access token instead of your password. The steps to do this are as follows:
- Go to your Personal Access Tokens settings in GitHub.
- Click on the Generate new token button.
- Name the token something descriptive.
- Select which scopes you wish to grant this token.
- Click the Generate token button.
- Copy the token and use it as a password in your hosted repositories.
Source
If your password recently changed, select the repository, go to Tools --> options, go to Authentication tab and delete the stored password. This will make the system request a new password when you next try to connect.
On OSX: go to SourceTree --> Preferences --> Network and delete the default username there.