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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,576
Community Members
 
Community Events
176
Community Groups

Publickey stopped working on one repository

Edited

This evening I pushed some commits to a repo using SourceTree, which worked just fine. A short time later, I tried pushing some more and suddenly the publickey decided not to work, asking for a password and then telling me that passwords were now disabled. If I check with ssh -T, it assures me that the key is just fine, and if I try pushing something to another repo, that works also, so it's nothing to do with the key itself. I tried restarting SourceTree, which prompted for my master key as expected, but it still refused to push to the repo. I tried the WSL command line and that also failed. I tried TortoiseGit and that failed, but again, just for the one repository.

I was helping one of my colleagues a few days ago who had a similar problem, and it mysteriously started working again for him after a while, but I've not been lucky with that yet.

I just tried a pull from the repository and it won't let me do that either, but once again, other repos are just fine.

I can view the repository and its files on the web just fine.

Edit to add: it's some sort of local repository corruption. I was able to clone the repository  to a new directory OK, copy the modified files from the previous one, commit and push.

1 answer

1 accepted

0 votes
Answer accepted

I seem to have figured out a solution, even though I don't know why it broke, but in case it helps someone else, this is what appears to have happened:

Go look at the git config (.git/config) file and under remote origin, it will have 

url = https://....
fetch = +refs/heads/*:refs/remotes/origin/*

and no mention of an ssh key. 

What you need there is 

url = git@bitbucket.org:...
fetch = +refs/heads/*:refs/remotes/origin/*
puttykeyfile = ...

The quickest way to fix it seems to be to clone the repository to somewhere else and copy over the config file from the new one to the old one, or at least copy the remote section.

Another variation reported by a colleague appears to be where the url is correct but the line defining the key file is missing.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events