{"id":49335568,"url":"https://github.com/thalsi/git","last_synced_at":"2026-04-27T00:32:31.283Z","repository":{"id":174253360,"uuid":"651983606","full_name":"thalsi/git","owner":"thalsi","description":"Master Git step-by-step from beginner to advanced. Check off tasks as you complete them!","archived":false,"fork":false,"pushed_at":"2025-07-03T14:13:23.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T15:25:51.002Z","etag":null,"topics":["git","github","tutorial"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thalsi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-10T17:46:32.000Z","updated_at":"2025-07-03T14:13:26.000Z","dependencies_parsed_at":"2025-07-03T15:26:02.463Z","dependency_job_id":"8d7859eb-35f7-4370-97f9-ac88047fb3c8","html_url":"https://github.com/thalsi/git","commit_stats":null,"previous_names":["thalsi/learn-git","thalsi/git"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thalsi/git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thalsi%2Fgit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thalsi%2Fgit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thalsi%2Fgit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thalsi%2Fgit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thalsi","download_url":"https://codeload.github.com/thalsi/git/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thalsi%2Fgit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32318417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"ssl_error","status_checked_at":"2026-04-26T23:26:25.802Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","github","tutorial"],"created_at":"2026-04-27T00:32:31.174Z","updated_at":"2026-04-27T00:32:31.267Z","avatar_url":"https://github.com/thalsi.png","language":"JavaScript","readme":"# ✅ Git Mastery Checklist (Beginner → Advanced)\n\n---\n🟢 Beginner\n\n## 🧩 1. Setup \u0026 Configuration\n- [x] Install Git\n- [x] git config --global user.name \"Your Name\"\n- [x] git config --global user.email \"you@example.com\"\n- [x] Set default branch: `init.defaultBranch main`\n- [x] Set default editor: VS Code, Vim, etc.\n- [x] Enable color UI\n- [x] View current config: `git config --list`\n- [x] View current config: `git config --list --global`\n\n---\n\n## 📁 2. Git Basics\n- [x] git init\n        - Initialize a new Git repository.\n- [x] git status\n        - Check the status of files — modified, staged, untracked.\n- [x] git add \u003cfile\u003e / git add .\n        - Stage file(s) to be committed.\n- [x] git commit -m \"message\"\n        - Commit staged changes with a message.\n- [x] git log / git log --oneline\n        - View commit history (detailed or short).\n- [x] git diff\n        - See what’s changed before staging.\n- [x] git show\n        - Show the details of a specific commit.\n- [x] Use .gitignore\n        - Ignore files you don’t want Git to track (e.g., node_modules/, env, dist).\n\n---\n\n## 🌿 3. Branching \u0026 Merging\n1. Branching\n\n- [x] `git branch` – List all local branches  \n- [x] `git branch \u003cname\u003e` – Create a new branch  \n- [x] `git switch \u003cbranch\u003e` – Switch to a branch (newer)  \n- [x] `git checkout \u003cbranch\u003e` – Switch to a branch (older method)  \n- [x] `git checkout -b \u003cname\u003e` – Create and switch to a new branch  \n- [x] `git branch -d \u003cname\u003e` – Delete a local branch (safe)  \n- [x] `git branch -D \u003cname\u003e` – Delete a local branch (force)  \n- [x] `git branch -m \u003cnew\u003e` – Rename current branch  \n- [x] `git branch -vv` – Show branches with last commit info  \n- [x] `git push origin \u003cbranch\u003e` – Push branch to remote  \n- [x] `git push --set-upstream origin \u003cbranch\u003e` – Link local branch to remote\n- [x] `git fetch --all` – Fetches all branches from all remotes (usually just origin) but does NOT merge or checkout anything.\n- [x] `git fetch -p` – It tells Git to remove (prune) any remote-tracking branches that no longer exist on the remote.\n\n2. Merging\nGit Merge is used to combine changes from one branch into another.\nUsually, you merge a feature branch into a main/stable branch.\n\n📦 Merge Types in Git\n\n| Merge Type                           | Description                                                 |\n| ------------------------------------ | ----------------------------------------------------------- |\n| 🟢 Fast-forward Merge                | Simple move of the pointer if there’s no diverging history. |\n| 🟡 Recursive Merge                   | The default merge strategy when branches have diverged.     |\n| 🔵 No Fast-forward Merge (`--no-ff`) | Always creates a merge commit to preserve history.          |\n| 🔴 Manual Merge                      | Required when there’s a **conflict**.                       |\n\n✳️ Common Merge Commands\n- [x] `git merge \u003cbranch\u003e` – Merge the given branch into the current branch  \n- [x] `git merge --no-ff \u003cbranch\u003e` – Force a merge commit even on fast-forward  \n- [x] `git merge --squash \u003cbranch\u003e` – Merge and squash into a single commit  \n- [x] `git merge --abort` – Abort a merge in progress  \n- [x] `git merge --continue` – Continue merge after resolving conflicts  \n\n---\n\n## 🌐 4. Remote Repositories\n- [x] git remote add origin \u003curl\u003e\n- [x] git push -u origin main\n- [x] git push / git pull\n- [x] git clone \u003curl\u003e\n- [x] git remote -v\n- [x] git push --set-upstream origin \u003cbranch\u003e\n- [x] git branch -vv\n- [x] git branch --set-upstream-to\n\n---\n\n## 🧼 5. Undo \u0026 History Fixing\n- [x] git reset --soft / --mixed / --hard\n- [x] git restore \u003cfile\u003e\n- [x] git restore . \u003cfile\u003e\n- [x] git restore --staged \u003cfile\u003e\n- [x] git commit --amend\n- [x] git reflog\n- [x] git clean -fd\n- [x] git reset --merge (undo merge)\n\n---\n🟡 Intermediate\n\n## 🔁 6. Rebase \u0026 Cherry-Pick\n\n### 🍒 Cherry-pick\n- [x] `git cherry-pick \u003ccommit\u003e` – Apply specific commit from another branch  \n- [x] `git cherry-pick commit1 commit2 commit3` – You can also cherry-pick multiple commits\n- [x] `git cherry-pick A^..B` –  even a range of commits\n\n### Rebase\ngit rebase moves or reapplies commits from one branch on top of another.\nIt rewrites history to create a cleaner, linear commit history.\n\n🎯 When to Use Rebase\n✅ Clean up history\n✅ Avoid extra merge commits\n✅ Keep project history linear\n✅ Re-apply your local feature branch on top of main\n\n- [x] `git rebase \u003cbranch\u003e` – Reapply current branch commits on top of `\u003cbranch\u003e`  \n- [x] `git rebase -i \u003cbranch\u003e` – Interactive rebase: squash, reword, drop commits  \n- [x] `git rebase -i HEAD~n` – Interactively edit the last `n` commits  \n- [x] `git rebase --autosquash` – Auto-squash commits marked with `fixup!` or `squash!`  \n- [x] `git rebase --continue` – Continue rebase after resolving conflicts  \n- [x] `git rebase --abort` – Abort the rebase and return to the previous state  \n- [x] `git rebase --skip` – Skip the current conflicting commit during rebase  \n- [x] `git pull --rebase` – Pull latest changes using rebase instead of merge  \n- [x] `git status` – Check status during rebase (conflicts, progress)  \n- [x] `git log` – Review commit history before/after rebase  \n- [x] Resolve conflicts manually – Fix file conflicts and mark as resolved  \n\n| Command  | `git rebase -i \u003cbranch\u003e` Meaning                  |\n| -------- | ------------------------------------------------- |\n| `pick`   | Keep commit as-is                                 |\n| `reword` | Change commit message                             |\n| `edit`   | Pause to change content                           |\n| `squash` | Combine with previous commit (keep both messages) |\n| `fixup`  | Combine with previous, discard this message       |\n| `drop`   | Delete this commit                                |\n---\n\n## 🏷️ 7. Tags \u0026 Releases\n- [x] git tag \u003cname\u003e\n- [x] git tag -a \u003cname\u003e -m \"message\"\n- [x] git show \u003ctag\u003e\n- [x] git push origin \u003ctag\u003e\n- [x] git push --tags\n\n---\n\n## 📦 8. Stashing \u0026 Cleaning\n\n- [x] `git stash` – Stash tracked modified files\n- [x] `git stash -u` – Stash tracked + untracked files (not ignored)\n- [x] `git stash -a` – Stash all (tracked + untracked + ignored)\n- [x] `git stash list` – View list of stashes\n- [x] `git stash show` – Show summary of latest stash\n- [x] `git stash show -p` – Show patch/diff of latest stash\n- [x] `git stash pop` – Apply stash and delete it\n- [x] `git stash apply` – Apply stash but keep it\n- [x] `git stash drop` – Delete latest stash\n- [x] `git stash clear` – Delete all stashes\n- [x] `git stash push -m \"message\"` – Stash with custom message\n\n---\n\n## 🔍 9. Git Inspection Tools\n- [x] git log with formatting\n- [x] git diff --cached\n- [x] git blame \u003cfile\u003e\n- [x] git describe\n- [x] git shortlog\n- [x] git shortlog -sn\n\n---\n\n## 👥 10. Team Collaboration\n- [x] Use Pull Requests / Merge Requests\n- [x] Feature branch workflow\n- [x] Gitflow workflow\n- [x] Code review \u0026 approvals\n- [x] Protected branches\n- [x] Squash commits before merge\n\n---\n\n## 🛠️ 11. Git Hooks \u0026 Automation\n- [x] Setup Husky for hooks\n- [x] Use pre-commit, commit-msg, post-merge\n- [x] Use lint-staged for auto formatting\n- [x] Create .husky/ scripts\n- [ ] Use `git commit --no-verify` (with caution)\n\n---\n\n## 🗂️ 12. Aliases \u0026 Tools\n- [ ] Create git aliases\n- [ ] Use Git GUI tools\n- [ ] Use .gitattributes\n- [ ] Try https://learngitbranching.js.org\n- [ ] Use GitLens in VS Code\n- [ ] Use `diff-so-fancy` for better diffs\n\n---\n\n## ⚙️ 13. Git Internals (Advanced)\n- [ ] Understand .git/ structure\n- [ ] Git Object Types: blob, tree, commit, tag\n- [ ] Learn about HEAD, refs, index\n- [ ] Learn SHA-1 and commit IDs\n\n---\n\n## 🐞 14. Debugging \u0026 Recovery\n- [ ] Conflict resolution\n- [ ] Detached HEAD fixes\n- [ ] Use reflog to recover lost commits\n- [ ] git bisect start / bad / good (binary search debugging)\n\n---\n\n## 🚀 15. CI/CD Integration\n- [ ] Setup GitHub Actions or GitLab CI\n- [ ] Configure .github/workflows/\n- [ ] Use CI for test/lint/build\n- [ ] Auto deployment with git tags\n- [ ] Test GitHub Actions locally with `act`\n\n---\n\n## ✏️ 16. Commit Message Standards\n- [x] Use Conventional Commits (feat:, fix:, chore:, etc.)\n- [x] Install commitlint\n- [x] Use Commitizen (cz) for commits\n- [x] Validate commits with hooks\n\n---\n\n## 📁 17. Monorepo \u0026 Submodules\n- [ ] git submodule add\n- [ ] git submodule update --init\n- [ ] Learn subtrees (optional)\n- [ ] Use Nx or Lerna for monorepo\n\n---\n🔴 Advanced\n\n## 🔐 18. Security \u0026 Best Practices\n- [ ] Use .env files and gitignore\n- [ ] Install git-secrets\n- [ ] GPG sign commits\n- [ ] Enable 2FA on GitHub\n- [ ] Remove secrets from history (BFG or git filter-branch)\n\n---\n\n## 🏢 19. Git in Teams\n- [ ] Simulate team workflows\n- [ ] Use pair programming tools (git-duet)\n- [ ] Create/merge PRs\n- [ ] Trunk-based development\n- [ ] Fork vs shared branch model\n\n---\n\n## 🌍 20. Git Hosting Platforms\n- [ ] GitHub\n- [ ] GitLab\n- [ ] Bitbucket\n- [ ] Azure Repos\n\n---\n\n## 🧪 21. Extra Git Tools\n- [ ] git worktree (multiple working dirs)\n- [ ] git archive (create zip/tar)\n- [ ] git format-patch / git apply / git am (email-based flow)\n- [ ] git fame (contribution analytics)\n- [ ] git LFS for large files\n\n---\n\n## 📚 22. Learning Resources\n- [ ] https://git-scm.com/book\n- [ ] https://learngitbranching.js.org\n- [ ] https://ohmygit.org\n- [ ] Git cheatsheets from GitHub\n\n---\n\n## ✍️ BONUS: Aliases to Save Time\n```bash\ngit config --global alias.st status\ngit config --global alias.co checkout\ngit config --global alias.br branch\ngit config --global alias.cm commit\ngit config --global alias.lg \"log --oneline --graph --all\"\n```\n\n---\n\n## 🧠 23. Advanced History \u0026 Commit Management\n- [ ] git commit --fixup and git rebase --autosquash\n- [ ] git notes – add metadata/comments to commits\n- [ ] git revert -n (stage multiple reverts)\n- [ ] Understand orphan branches: git checkout --orphan newbranch\n\n---\n\n## 🗃️ 24. Repo Size \u0026 History Optimization\n- [ ] git gc (garbage collection to optimize repo)\n- [ ] git repack (compress objects)\n- [ ] git verify-pack / git count-objects -v (inspect storage)\n- [ ] Use BFG Repo-Cleaner for large repos\n\n---\n\n## 🛡️ 25. Git \u0026 Compliance\n- [ ] Audit history for secrets (truffleHog, gitleaks)\n- [ ] Enforce signed commits via branch protection\n- [ ] Enforce linear history in main branch\n- [ ] Use branch naming conventions and enforce them\n\n---\n\n## ⚡ 26. Git Performance \u0026 Scaling\n- [ ] Use git sparse-checkout (large monorepos)\n- [ ] Partial clone (--filter=blob:none) for huge projects\n- [ ] Split large repos with git subtree split\n\n---\n\n## 🔧 27. Custom Git Workflows\n- [ ] Setup custom merge drivers\n- [ ] Setup .mailmap to unify commit authors\n- [ ] Use .git/info/exclude for local-only ignores\n- [ ] Custom diff drivers (e.g., for .psd files)\n\n---\n\n## 📈 28. Git Analytics \u0026 Stats\n- [ ] Generate contributor graphs (git shortlog, git fame)\n- [ ] Generate churn stats (git log --stat)\n- [ ] Track contribution activity with git log --since or GitHub Insights\n\n---\n\n## 🔁 29. Git Replace \u0026 Filter Branch\n- [ ] git replace to swap objects in history\n- [ ] git filter-branch for complex rewriting\n- [ ] Use with caution — avoid on shared history\n\n---\n\n## 🌐 30. Git Across Environments\n- [ ] Use Git with GitHub CLI (gh)\n- [ ] Use Git in CI runners and scripts\n- [ ] Use Git in Docker images for automation\n- [ ] Access GitHub/GitLab via REST API\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthalsi%2Fgit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthalsi%2Fgit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthalsi%2Fgit/lists"}