Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Unable to push a commit to Github repository

I have this problem with pushing a commit to a github repository. I am using a 3.1.1 version Sourcetree and a Mac. Please help! Thanks!

This is what I've got from Sourcetree: 

Pushing to https://username@github.com/username/repo.git

remote: Permission to username/repo.git denied to username.

fatal: unable to access 'https://username@github.com/username/repo.git/': The requested URL returned error: 403

2 answers

Hi @Haiyi Zhang ,

Based on the response error (403), it seems the username in https://username@github... does not have permissions to push changes to the repo in question.

Could you please confirm the user (username) is able to authenticate against the repository and push changes to it. This can be tested from Terminal in your Mac, using the same user logged in that is running Sourcetree.

Another thing you could do would be enabling DEBUG in Sourcetree (https://community.atlassian.com/t5/Sourcetree-articles/Tip-from-the-team-debugging-Sourcetree/ba-p/794778), so you can get more information (in logs) about the issue you have mentioned.

Hope the above helps. If not, please provide us with more information (e.g logs) so we can better assist you.

Kind regards,
Rafael

Hi @Rafael Pinto Sperafico ,

Thanks for replying!

Do you know how to test it from the terminal on my Mac? 

Also, I tried to enable DEBUG as you suggested but there wasn't this debug menu. Screen Shot 2019-03-17 at 4.04.45 PM.png

Hi @Haiyi Zhang ,

You can test that by simply cloning the repository and pushing changes to it. If your user (username) has permissions to write to the repository, the we can determine the issue is somehow related to Sourcetree.

Please, follow the instructions on Example: Contribute to an existing repository from this link (https://guides.github.com/introduction/git-handbook/).

Out of curiosity, when this issue started happening? Where you able to push changes to the very same repository or is this the first time you are attempting on pushing changes?

Also, is the repository yours or someone else?

Kind regards,
Rafael

Hi @Rafael Pinto Sperafico

This is someone else's repository. She said she gave me the permission to read and write on her repository. 

This was my first attempt to push changes. I was able to pull and merge whenever there was new update from others.

Hi @Rafael Pinto Sperafico

I was able to push changes to repository through the terminal. I guess the issue is related to Sourcetree. Thanks! 

I'm able to push commit to github after setting github "SSH Key" to SourceTree.

Here are the steps:

1. open sourceTree Options: Tools -> Options

2. input your github access token to "SSH Key"

3. OK! It works.

 

The github access token can be got in this way: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line

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...

3,390 views 4 5
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