FAQ

What is the difference between Git and GitHub?

Git is a version control system that runs locally. GitHub is a cloud platform that hosts Git repositories and adds collaboration features like pull requests, issues, and actions.

How do I undo the last commit?

# Keep changes in working directory
git reset --soft HEAD~1

# Discard changes entirely
git reset --hard HEAD~1

git reset --hard permanently deletes uncommitted changes.

How do I resolve a merge conflict?

  1. Open the conflicting file - look for <<<<<<<, =======, >>>>>>> markers
  2. Edit the file to keep the desired changes
  3. Stage and commit:
git add .
git commit -m "resolve merge conflict"

How do I create a personal access token?

  1. Go to Settings > Developer settings > Personal access tokens
  2. Click Generate new token
  3. Select scopes and click Generate token
  4. Copy the token - it won’t be shown again

How do I add SSH keys?

ssh-keygen -t ed25519 -C "your@email.com"
cat ~/.ssh/id_ed25519.pub

Copy the output and add it in Settings > SSH and GPG keys > New SSH key.


This site uses Just the Docs, a documentation theme for Jekyll.