Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

2FA for GitHub not working in SourceTree

This question is in reference to Atlassian Documentation: Two-Factor Authentication (2FA) with GitHub in SourceTree

I set up 2FA for GitHub with a Yubikey this works fine when I use git from the command line.

But when I use it with SoureTree I get an error message:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v origin refs/heads/master:refs/heads/master 
Pushing to git@github.com:the4thfloor/test.git
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Pushing to git@github.com:the4thfloor/test.git
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Pushing to git@github.com:the4thfloor/test.git
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Pushing to git@github.com:the4thfloor/test.git
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Completed with errors, see aboveCompleted with errors, see above

When I call this command on command line I get this output

$ git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v origin refs/heads/master:refs/heads/master 
Pushing to git@github.com:the4thfloor/test.git
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 944 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local objects.
To github.com:the4thfloor/test.git
   0c607d1..9a695cf  master -> master
updating local tracking ref 'refs/remotes/origin/master'

What can I do?

4 answers

This does still does not work reliably.

This remains a terrible and broken user experience.

You are forcing people to choose between good security (2FA) or using your software.

Okay I got it. You have to use the access token as password (like it's described in the article).

The important part is that you have to access via https and not via ssh

 

But why can't SoureTree use the command line settings to access GitHUb?

2FA is not working with FreeOTP on Android. The code is accepted during setup but not for logon.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

2,975 views 4 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you