Skip to content

Git

basic setup

git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

create new key pair

ssh-keygen -t ed25519 -b 4096 -C "{username@emaildomain.com}" -f {ssh-key-name}

Copy the new key file to the ssh directory

cp {ssh-key-name} ~/.ssh/

Then add the below to ~/.ssh/config

Host bitbucket.org
  AddKeysToAgent yes
  IdentityFile ~/.ssh/{ssh-key-name}

Add the SSH Public Key to Bitbucket : Link

Notes:

undo last commit [SRC]

git log --oneline

# 3fad532  Last commit   (HEAD)
# 3bnaj03  Commit before HEAD   (HEAD~1)
# vcn3ed5  Two commits before HEAD   (HEAD~2)

git reset --soft HEAD~1