Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Git / BitBucket

1. Check if your SSH key exists

ls -al ~/.ssh

2. Make sure SSH agent is running and key is added

# Start agent:
eval "$(ssh-agent -s)"
# Add your key:
ssh-add ~/.ssh/id_ed25519
# Now verify:
ssh-add -l

3. Make sure you added the PUBLIC key to Bitbucket

# Copy your public key:
cat ~/.ssh/id_ed25519.pub

Copy the whole output and paste it into:

  • Bitbucket → Profile → Personal settings → SSH keys → Add key Make sure:
  • You didn’t paste the private key (id_ed25519) No extra spaces or line breaks

4. Test SSH connection

ssh -T git@bitbucket.org

Create an SSH key pair

ssh-keygen -t ed25519 -b 4096 -C "{username@emaildomain.com}" -f ~/.ssh/{ssh-key-name}
# Example
ssh-keygen -t ed25519 -b 4096 -C "username@emaildomain.com" -f ~/.ssh/id_ed25519
  • {username@emaildomain.com} is the email address associated with the Bitbucket Cloud account, such as your work email account.
  • {ssh-key-name} is the output filename for the keys. We recommend using a identifiable name such as bitbucket_work.

If wanna debug

# This gives detailed debugging info
ssh -vvv git@bitbucket.org

# If want to add key manually
ssh-add ~/.ssh/private_keyname

# And check by:
ssh-add -l

Single SSH Key Setup (Recommended)

# Step 1: Generate ONE key pair:
ssh-keygen -t ed25519 -C "your_email@example.com"

# Press Enter to accept default location (~/.ssh/id_ed25519).

# Step 2: Add public key to GitHub:
cat ~/.ssh/id_ed25519.pub

## Copy output → GitHub Settings → SSH and GPG Keys → New SSH Key → Paste → Save

# Step 3: Test connection:
ssh -T git@github.com

# Should output:
# Hi username! You've successfully authenticated...

NOTE: For below kind of error sometimes sudo could be your biggest enemy, so try with/without that too!

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

About

Git troubleshooting repository with real-world issues, debugging techniques, and step-by-step solutions. Covers authentication, merge conflicts, branching strategies, SSH setup, and common Git workflows.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors