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?
- Open the conflicting file - look for
<<<<<<<,=======,>>>>>>>markers - Edit the file to keep the desired changes
- Stage and commit:
git add .
git commit -m "resolve merge conflict"
How do I create a personal access token?
- Go to Settings > Developer settings > Personal access tokens
- Click Generate new token
- Select scopes and click Generate token
- 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.