{"id":29861187,"url":"https://github.com/atharvbyadav/git-github","last_synced_at":"2026-02-21T11:02:18.351Z","repository":{"id":278189801,"uuid":"914779258","full_name":"atharvbyadav/Git-GitHub","owner":"atharvbyadav","description":"📚 A complete beginner-to-advanced guide to mastering Git and GitHub — packed with essential commands, practical workflows, and collaboration best practices.","archived":false,"fork":false,"pushed_at":"2025-06-10T06:29:57.000Z","size":3619,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T19:43:32.690Z","etag":null,"topics":["cheatsheet","cli","collaboration","developer-tools","documentation","git","git-guide","git-workflow","github","markdown","open-source","version-control"],"latest_commit_sha":null,"homepage":"https://atharvbyadav.github.io/Git-GitHub/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atharvbyadav.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":"2025-01-10T09:38:51.000Z","updated_at":"2025-07-13T13:18:30.000Z","dependencies_parsed_at":"2025-02-18T13:41:36.808Z","dependency_job_id":"f4670336-778d-4764-8689-a964691bf9fb","html_url":"https://github.com/atharvbyadav/Git-GitHub","commit_stats":null,"previous_names":["atharvbyadav/git-github"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/atharvbyadav/Git-GitHub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharvbyadav%2FGit-GitHub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharvbyadav%2FGit-GitHub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharvbyadav%2FGit-GitHub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharvbyadav%2FGit-GitHub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atharvbyadav","download_url":"https://codeload.github.com/atharvbyadav/Git-GitHub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atharvbyadav%2FGit-GitHub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29679049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T09:33:50.764Z","status":"ssl_error","status_checked_at":"2026-02-21T09:33:19.949Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["cheatsheet","cli","collaboration","developer-tools","documentation","git","git-guide","git-workflow","github","markdown","open-source","version-control"],"created_at":"2025-07-30T04:13:03.863Z","updated_at":"2026-02-21T11:02:18.332Z","avatar_url":"https://github.com/atharvbyadav.png","language":"HTML","readme":"# 🚀 Git and GitHub Guide\n\nWelcome to your **all-in-one guide** to mastering Git and GitHub! Whether you're a beginner just starting out or an experienced developer brushing up on advanced features, this guide covers everything with easy-to-understand commands, explanations, and best practices.\n\n*Visit the live site at [https://atharvbyadav.github.io/Git-GitHub/](https://atharvbyadav.github.io/Git-GitHub/)*\n\u003cp align=\"center\"\u003e\n  \u003c!-- General Tech Stack / Topic Tags --\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Markdown-%23f7df1e.svg?style=for-the-badge\u0026logo=markdown\u0026logoColor=black\" alt=\"Markdown\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Git-F05032?style=for-the-badge\u0026logo=git\u0026logoColor=white\" alt=\"Git\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/GitHub-100000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"GitHub\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Open%20Source-%2300b894?style=for-the-badge\u0026logo=open-source-initiative\u0026logoColor=white\" alt=\"Open Source\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Version%20Control-E44D27?style=for-the-badge\u0026logo=git\u0026logoColor=white\" alt=\"Version Control\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003c!-- Extra Utility Badges --\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Beginner%20Friendly-33CC99?style=for-the-badge\" alt=\"Beginner Friendly\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Documentation%20Project-3366FF?style=for-the-badge\" alt=\"Documentation Project\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Contributions%20Welcome-ff69b4?style=for-the-badge\" alt=\"Contributions Welcome\"\u003e\n\u003c/p\u003e\n\n\n\u003e 📌 *Version control is not just a tool — it's a discipline. The cleaner your history, the clearer your future.*\n\n---\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/atharvbyadav/Git-GitHub/main/banner.png\" alt=\"Mastering WSL\" width=\"500\" /\u003e\n\u003c/p\u003e\n\n---\n\n## 📚 Table of Contents\n\n- [🚀 Git and GitHub Guide](#-git-and-github-guide)\n  - [📚 Table of Contents](#-table-of-contents)\n  - [🛠️ What is Git?](#️-what-is-git)\n    - [🔑 Key Features:](#-key-features)\n  - [☁️ What is GitHub?](#️-what-is-github)\n    - [💡 Why Use GitHub?](#-why-use-github)\n  - [🧱 Installing Git](#-installing-git)\n    - [🔽 For Windows:](#-for-windows)\n    - [🍎 For macOS:](#-for-macos)\n    - [🐧 For Linux:](#-for-linux)\n    - [✅ Verify Installation:](#-verify-installation)\n  - [🔧 Git Configuration](#-git-configuration)\n    - [Optional Goodies:](#optional-goodies)\n  - [🧰 Basic Git Commands](#-basic-git-commands)\n    - [🔹 Initialize a Repository](#-initialize-a-repository)\n    - [🔹 Clone a Repository](#-clone-a-repository)\n    - [🔹 Check Status](#-check-status)\n    - [🔹 Stage Files](#-stage-files)\n    - [🔹 Commit Changes](#-commit-changes)\n    - [🔹 View Commit History](#-view-commit-history)\n    - [🔹 Undo Last Commit (Keep Changes)](#-undo-last-commit-keep-changes)\n  - [🌐 Working with GitHub](#-working-with-github)\n    - [🔗 Connect Local Repo to GitHub](#-connect-local-repo-to-github)\n    - [🚀 Push Changes](#-push-changes)\n    - [⬇️ Pull Changes](#️-pull-changes)\n    - [🔁 Clone Then Push to New Repo](#-clone-then-push-to-new-repo)\n  - [✏️ Renaming \\\u0026 Removing Files](#️-renaming--removing-files)\n    - [📝 Rename a File](#-rename-a-file)\n    - [🗑️ Remove a File](#️-remove-a-file)\n    - [✅ Commit and Push](#-commit-and-push)\n  - [🌿 Branching \\\u0026 Merging](#-branching--merging)\n    - [🌱 Create a New Branch](#-create-a-new-branch)\n    - [🔄 Switch to a Branch](#-switch-to-a-branch)\n    - [➕ Create \\\u0026 Switch in One Step](#-create--switch-in-one-step)\n    - [🔁 Merge a Branch into Main](#-merge-a-branch-into-main)\n    - [🧹 Delete a Merged Branch](#-delete-a-merged-branch)\n    - [🧭 See All Branches](#-see-all-branches)\n    - [🌍 Push a Branch to GitHub](#-push-a-branch-to-github)\n  - [📦 Stashing \\\u0026 Cleaning](#-stashing--cleaning)\n    - [🧳 Temporarily Save Changes (Stash)](#-temporarily-save-changes-stash)\n    - [🎯 Reapply Stashed Changes](#-reapply-stashed-changes)\n    - [🧼 Remove Untracked Files](#-remove-untracked-files)\n  - [🕘 Rewriting History](#-rewriting-history)\n    - [🔄 Amend Last Commit](#-amend-last-commit)\n    - [🚫 Undo a Commit (Soft Reset)](#-undo-a-commit-soft-reset)\n    - [💥 Hard Reset to Last Commit](#-hard-reset-to-last-commit)\n  - [📜 Logs \\\u0026 Diffs](#-logs--diffs)\n    - [📖 View Commit History](#-view-commit-history-1)\n    - [🔍 View File Differences](#-view-file-differences)\n  - [🏷️ Tags](#️-tags)\n    - [🔖 Create a Tag](#-create-a-tag)\n    - [🚀 Push Tags to GitHub](#-push-tags-to-github)\n    - [📋 List Tags](#-list-tags)\n  - [🌱 Rebasing \\\u0026 Cherry Picking](#-rebasing--cherry-picking)\n    - [🔄 Rebase a Branch](#-rebase-a-branch)\n    - [🍒 Cherry Pick a Commit](#-cherry-pick-a-commit)\n  - [📦 Git Submodules](#-git-submodules)\n    - [➕ Add a Submodule](#-add-a-submodule)\n    - [🔄 Init \\\u0026 Update](#-init--update)\n  - [⚡ Git Aliases](#-git-aliases)\n  - [🤝 Collaborating with Others](#-collaborating-with-others)\n    - [🍴 Fork a Repository](#-fork-a-repository)\n    - [🌲 Clone Your Fork](#-clone-your-fork)\n    - [🔀 Add the Original Repository as \"Upstream\"](#-add-the-original-repository-as-upstream)\n    - [🔄 Sync Your Fork](#-sync-your-fork)\n    - [📤 Create a Pull Request (PR)](#-create-a-pull-request-pr)\n  - [⚔️ Resolving Merge Conflicts](#️-resolving-merge-conflicts)\n    - [🧩 To Resolve:](#-to-resolve)\n  - [💡 Best Practices](#-best-practices)\n    - [📄 Sample `.gitignore` for Node.js](#-sample-gitignore-for-nodejs)\n  - [🎯 Final Words](#-final-words)\n  - [🙌 Stay Connected](#-stay-connected)\n\n---\n\n## 🛠️ What is Git?\n\n**Git** is like a time machine for your code. It tracks changes, helps multiple developers work together, and lets you rewind to any point in your project history.\n\n### 🔑 Key Features:\n- Keeps track of file changes\n- Supports branching and merging\n- Works offline and distributed\n- Safe experimentation with branches\n\n---\n\n## ☁️ What is GitHub?\n\n**GitHub** is where Git comes alive online. It's a platform for storing your Git repositories in the cloud, working with others, managing projects, and automating tasks with CI/CD.\n\n### 💡 Why Use GitHub?\n- Host code in the cloud  \n- Collaborate via pull requests  \n- Track issues and tasks  \n- Automate with GitHub Actions  \n\n---\n\n## 🧱 Installing Git\n\n### 🔽 For Windows:\n- Download Git from [git-scm.com](https://git-scm.com/)\n- Follow the installation wizard (use defaults if unsure)\n\n### 🍎 For macOS:\n```bash\nbrew install git\n```\n\n### 🐧 For Linux:\n```bash\nsudo apt install git       # Ubuntu/Debian\nsudo yum install git       # RHEL/CentOS\n```\n\n### ✅ Verify Installation:\n```bash\ngit --version\n```\n\n---\n\n## 🔧 Git Configuration\n\nConfigure Git globally so it knows who you are:\n\n```bash\ngit config --global user.name \"Pro User\"\ngit config --global user.email \"User@example.com\"\n```\n\n### Optional Goodies:\n```bash\ngit config --global core.editor \"code --wait\"   # VSCode as default editor\ngit config --global color.ui auto               # Enable colored output\ngit config --global alias.co checkout           # Shortcut for checkout\n```\n\n---\n\n## 🧰 Basic Git Commands\n\nHere's your day-to-day Git toolkit:\n\n### 🔹 Initialize a Repository\n```bash\ngit init\n```\n*Creates a new Git repository in the current folder.*\n\n---\n\n### 🔹 Clone a Repository\n```bash\ngit clone https://github.com/user/repo.git\n```\n*Copies a remote repo to your local machine.*\n\n---\n\n### 🔹 Check Status\n```bash\ngit status\n```\n*Shows what's changed and what's ready to commit.*\n\n---\n\n### 🔹 Stage Files\n```bash\ngit add filename.ext     # Stage one file\ngit add .                # Stage everything\n```\n*Tells Git what changes to include in the next commit.*\n\n---\n\n### 🔹 Commit Changes\n```bash\ngit commit -m \"Your commit message\"\n```\n*Saves your changes to the project history.*\n\n---\n\n### 🔹 View Commit History\n```bash\ngit log\ngit log --oneline\n```\n*Shows the list of past commits.*\n\n---\n\n### 🔹 Undo Last Commit (Keep Changes)\n```bash\ngit reset --soft HEAD~1\n```\n\n---\n\n## 🌐 Working with GitHub\n\n### 🔗 Connect Local Repo to GitHub\n```bash\ngit remote add origin https://github.com/yourusername/repo.git\ngit branch -M main\ngit push -u origin main\n```\n*Links your local Git project to a GitHub repository and pushes the main branch.*\n\n---\n\n### 🚀 Push Changes\n```bash\ngit push\n```\n*Sends your local commits to GitHub.*\n\n---\n\n### ⬇️ Pull Changes\n```bash\ngit pull\n```\n*Fetches and merges changes from GitHub into your local branch.*\n\n---\n\n### 🔁 Clone Then Push to New Repo\n```bash\ngit clone https://github.com/user/repo.git\ncd repo\n# make changes\ngit add .\ngit commit -m \"Initial commit\"\ngit push origin main\n```\n\n---\n\n## ✏️ Renaming \u0026 Removing Files\n\n### 📝 Rename a File\n```bash\ngit mv old_name.txt new_name.txt\n```\n*Git tracks this as a rename (rather than delete + add).*\n\n---\n\n### 🗑️ Remove a File\n```bash\ngit rm unwanted_file.txt\n```\n\n### ✅ Commit and Push\n```bash\ngit commit -m \"Renamed and removed files\"\ngit push\n```\n\n---\n\n## 🌿 Branching \u0026 Merging\n\n### 🌱 Create a New Branch\n```bash\ngit branch feature-xyz\n```\n\n### 🔄 Switch to a Branch\n```bash\ngit checkout feature-xyz\n```\n\n### ➕ Create \u0026 Switch in One Step\n```bash\ngit checkout -b bugfix-login\n```\n\n---\n\n### 🔁 Merge a Branch into Main\n```bash\ngit checkout main\ngit merge feature-xyz\n```\n\n---\n\n### 🧹 Delete a Merged Branch\n```bash\ngit branch -d feature-xyz\n```\n\n---\n\n### 🧭 See All Branches\n```bash\ngit branch        # local only\ngit branch -r     # remote only\ngit branch -a     # all\n```\n\n---\n\n### 🌍 Push a Branch to GitHub\n```bash\ngit push origin feature-xyz\n```\n\n---\n\n## 📦 Stashing \u0026 Cleaning\n\n### 🧳 Temporarily Save Changes (Stash)\n```bash\ngit stash\n```\n*Hides your uncommitted changes so you can switch branches safely.*\n\n### 🎯 Reapply Stashed Changes\n```bash\ngit stash pop\n```\n\n### 🧼 Remove Untracked Files\n```bash\ngit clean -f\n```\n*Deletes untracked files. Use with caution!*\n\n---\n\n## 🕘 Rewriting History\n\n### 🔄 Amend Last Commit\n```bash\ngit commit --amend\n```\n*Edit the previous commit message or add forgotten changes.*\n\n---\n\n### 🚫 Undo a Commit (Soft Reset)\n```bash\ngit reset --soft HEAD~1\n```\n*Keeps changes but removes the commit.*\n\n### 💥 Hard Reset to Last Commit\n```bash\ngit reset --hard HEAD\n```\n*⚠️ WARNING: This erases all changes permanently.*\n\n---\n\n## 📜 Logs \u0026 Diffs\n\n### 📖 View Commit History\n```bash\ngit log\ngit log --oneline --graph --all\n```\n\n### 🔍 View File Differences\n```bash\ngit diff                # unstaged vs working dir\ngit diff --staged       # staged vs last commit\n```\n\n---\n\n## 🏷️ Tags\n\n### 🔖 Create a Tag\n```bash\ngit tag v1.0.0\n```\n\n### 🚀 Push Tags to GitHub\n```bash\ngit push origin v1.0.0\n```\n\n### 📋 List Tags\n```bash\ngit tag\n```\n\n---\n\n## 🌱 Rebasing \u0026 Cherry Picking\n\n### 🔄 Rebase a Branch\n```bash\ngit checkout feature\ngit rebase main\n```\n*Rewrites your branch history on top of another branch.*\n\n---\n\n### 🍒 Cherry Pick a Commit\n```bash\ngit cherry-pick \u003ccommit-hash\u003e\n```\n*Applies a specific commit to your current branch.*\n\n---\n\n## 📦 Git Submodules\n\n### ➕ Add a Submodule\n```bash\ngit submodule add https://github.com/user/repo.git path/to/module\n```\n\n### 🔄 Init \u0026 Update\n```bash\ngit submodule init\ngit submodule update\n```\n\n*Submodules let you include another Git repo inside your repo (e.g., plugins, libs).*\n\n---\n\n## ⚡ Git Aliases\n\nSpeed up commands using aliases:\n\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 -m\"\n```\n\nThen use:\n```bash\ngit st        # Instead of git status\ngit co main   # Instead of git checkout main\n```\n\n---\n\n## 🤝 Collaborating with Others\n\n### 🍴 Fork a Repository\nOn GitHub, click **Fork** to create your own copy of someone else's repo.\n\n\u003e 💡 Great for contributing to open-source projects!\n\n---\n\n### 🌲 Clone Your Fork\n```bash\ngit clone https://github.com/yourusername/repo.git\ncd repo\n```\n\n---\n\n### 🔀 Add the Original Repository as \"Upstream\"\n```bash\ngit remote add upstream https://github.com/original/repo.git\n```\n*This helps you keep your fork updated with the original.*\n\n---\n\n### 🔄 Sync Your Fork\n```bash\ngit fetch upstream\ngit checkout main\ngit merge upstream/main\n```\n\n---\n\n### 📤 Create a Pull Request (PR)\n\n1. Push your changes to your forked repo:\n   ```bash\n   git push origin your-branch-name\n   ```\n2. On GitHub, click **\"Compare \u0026 pull request\"**.\n3. Write a clear title and description.\n4. Submit it for review.\n\n\u003e ✅ Tip: Make sure your branch is up-to-date before opening a PR.\n\n---\n\n## ⚔️ Resolving Merge Conflicts\n\nWhen Git can't merge changes automatically, it creates **conflict markers** in the file:\n\n```txt\n\u003c\u003c\u003c\u003c\u003c\u003c\u003c HEAD\nyour version\n=======\ntheir version\n\u003e\u003e\u003e\u003e\u003e\u003e\u003e branch-name\n```\n\n### 🧩 To Resolve:\n\n1. Edit the file to fix the conflict.\n2. Stage it again:\n   ```bash\n   git add conflicted_file\n   ```\n3. Commit the resolution:\n   ```bash\n   git commit\n   ```\n\n---\n\n## 💡 Best Practices\n\n✅ **Commit messages** should be clear and descriptive:  \n   _\"Fix: resolve login token expiration issue\"_\n\n✅ **Use branches** for every feature or bug fix.  \n   Keeps `main` clean and deployable.\n\n✅ **Pull often** to avoid diverging too far from the main branch.\n\n✅ **Push regularly** so work isn't lost.\n\n✅ **Don't commit sensitive files** (like `.env`, API keys).\n\n✅ **Use `.gitignore** to exclude files that shouldn't be tracked.\n\n---\n\n### 📄 Sample `.gitignore` for Node.js\n```gitignore\nnode_modules/\n.env\n*.log\n.DS_Store\n```\n\n---\n\n## 🎯 Final Words\n\nYou got it! Here's a strong, inspiring, and professional ending to cap off your README:\n\nMastering Git and GitHub is more than just learning commands — it's about developing a workflow that brings order, collaboration, and control to your development process. Whether you're building solo projects, working on a team, or contributing to open-source, **Git is your time machine, safety net, and collaboration tool all in one.**\n\nTake your time to **experiment, break things, fix them, and learn** — that's how real growth happens.\n\n\u003e 🧠 *\"The best developers aren't those who never make mistakes — they're the ones who track, manage, and learn from them.\"*\n\nKeep pushing code, keep pulling knowledge, and let your commit history tell the story of your evolution as a developer. 🌱✨\n\n---\n\n## 🙌 Stay Connected\n\nIf you found this guide helpful, give the repository a ⭐ on GitHub, share it with others, or fork it and build your own version!\n\nHave suggestions or want to contribute? Open a pull request — **collaboration starts here.** 💡\n\n---\n\nReady to take the next step?  \n\u003e **\"Go build. Break things. Fix them. Version everything.\"**\n\nHappy coding! 💻🔥\n\n---\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatharvbyadav%2Fgit-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatharvbyadav%2Fgit-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatharvbyadav%2Fgit-github/lists"}