-
Notifications
You must be signed in to change notification settings - Fork 0
Git & GitHub Tips
Sam edited this page Jul 21, 2025
·
1 revision
A quick reference for common Git commands, best practices, and GitHub workflows that support this learning project. This page is focused on personal use, small team collaboration, and structured growth.
| Action | Command |
|---|---|
| Initialise a repo | git init |
| Clone a remote repo | git clone <url> |
| Stage a file | git add <filename> |
| Stage everything | git add . |
| Commit with a message | git commit -m "✨ feat(js): added todo" |
| Push to origin | git push origin main |
| Pull latest changes | git pull |
| Create a branch | git checkout -b feature/react-counter |
| Switch branch | git checkout main |
| Merge a branch | git merge feature/react-counter |
| See commit history | git log --oneline --graph |
| Unstage a file | git restore --staged <filename> |
| Undo last commit (keep changes) | git reset --soft HEAD~1 |
Use GitHub Issues to log new:
- Learning topics
- Projects
- Bugs
- Questions Use templates and labels to stay organised.
git checkout -b type/short-description
# e.g. feat/html-form-guide or fix/quiz-bugUse conventional commit messages with emoji:
✨ feat(js): build fetch-based weather app
🐛 fix(dom): button event not triggering
📝 docs(css): update flexbox notesOnce you're ready:
git push -u origin feature/my-branchThen open a PR, link the issue, and let GitHub auto-label it.
## 📂 Recommended Branch Naming
| Prefix | Use For | Example |
|------------|------------------------------------|-------------------------------|
| `feat/` | New feature/project | `feat/react-todo-app` |
| `fix/` | Bug fixes | `fix/css-styles` |
| `docs/` | Wiki/notes/reflections | `docs/add-javascript-note` |
| `refactor/`| Internal clean-up | `refactor/js-functions` |
| `chore/` | CI, config, label, or meta changes | `chore/update-labeler` |Visualise your roadmap with columns like:
To LearnIn ProgressDone
Auto-label issues with:
- Topic (
topic:js) - Status (
status:in-progress) - Type (
type:project)
Use .github/labeler.yml + GitHub Actions to automate.
Make sure you use templates:
learning-topic.ymlproject.ymlbug.ymlreflection.yml
You can find these in
.github/ISSUE_TEMPLATE/
Automate:
- Prettier formatting
- Auto-label PRs
- Weekly digests
- Badge updates
- ✅ Use
git statusoften to see what’s changed - 🔁 Use
git stashto save WIP before switching tasks - 💥 Always pull before pushing (
git pull origin main) - 🔀 Don’t commit directly to
main— use branches - 🧪 Make small, focused PRs — it helps with learning & tracking