✨ 𝓖𝓲𝓽 𝓠𝓾𝓲𝓬𝓴 𝓝𝓸𝓽𝓮𝓼 — 𝓕𝓸𝓻 𝓘𝓷𝓽𝓮𝓻𝓿𝓲𝓮𝔀 & 𝓓𝓪𝓲𝓵𝔂 𝓤𝓼𝓮 ✨ 💡 𝓟𝓻𝓸 𝓣𝓲𝓹: Master these 15–20 commands = 90% of real-world Git usage 🔹 𝓖𝓲𝓽 𝓑𝓪𝓼𝓲𝓬𝓼 • Git → Version control system (tracks code changes) • GitHub → Cloud platform for Git collaboration 🔹 𝓤𝓼𝓮𝓻 𝓒𝓸𝓷𝓯𝓲𝓰 git config --global user.name "Abhishek Keshari" git config --global user.email "abhishek@keshari.com" git config --list git config user.name 🔹 𝓘𝓷𝓲𝓽 & 𝓗𝓮𝓵𝓹 git init → Initialize repo git help → Help docs git ls → List files (use: ls in terminal) 🔹 𝓢𝓽𝓪𝓰𝓲𝓷𝓰 git add . → Add all files git add fileName.ext → Add specific file 🔹 𝓒𝓸𝓶𝓶𝓲𝓽 git commit -m "message" 🔹 𝓢𝓽𝓪𝓽𝓾𝓼 & 𝓛𝓸𝓰 git status → Check changes git log → Commit history git log --author="Abhishek" 🔹 𝓓𝓲𝓯𝓯 git diff → Working vs repo git diff --staged → Staging vs repo 🔹 𝓕𝓲𝓵𝓮 𝓞𝓹𝓼 git rm file.ext → Delete file git mv old.txt new.txt → Rename git mv file.txt folder/file.txt → Move 🔹 𝓤𝓷𝓭𝓸 & 𝓡𝓮𝓬𝓸𝓿𝓮𝓻 git reset HEAD file.ext → Unstage file git checkout file.ext → Restore file git checkout commitId → Go to old version git checkout commitId -- file.ext → Restore specific file 🔹 𝓡𝓮𝓶𝓸𝓽𝓮 𝓡𝓮𝓹𝓸 git remote add origin <repoURL> git remote → List remotes 🔹 𝓟𝓾𝓼𝓱 git push -u origin branchName 🔹 𝓒𝓸𝓷𝓬𝓮𝓹𝓽𝓼 • Fork → Copy someone else's repo • Issues → Track bugs/tasks • .gitignore → Ignore files (node_modules, logs, etc.) #Git #GitHub #Developers #InterviewPrep #FullStack #JavaDeveloper #TechNotes
Master Git in 15 Commands: Essential Git Usage for Developers
More Relevant Posts
-
Git Cheat Sheet Every Developer Should Save If you keep forgetting Git commands… you’re not alone. Git is powerful, but only if you understand the right commands at the right time. Here’s a structured cheat sheet you’ll actually use 👇 1. Setup & Configuration git config --global user.name → Set your name git config --global user.email → Set your email git config --global color.ui auto → Better CLI visibility 2. Initialize & Clone git init → Start a new repository git clone [url] → Copy an existing repo 3. Stage & Commit (Most Used) git status → Check changes git add [file] → Stage file git commit -m "message" → Save snapshot git diff → See unstaged changes git diff --staged → See staged changes 4. Branching & Merging git branch → List branches git branch [name] → Create branch git checkout [branch] → Switch branch git merge [branch] → Merge changes 5. Remote Operations git remote add [alias] [url] → Connect repo git push → Upload code git pull → Fetch + merge updates git fetch → Get updates without merging 6. Tracking Changes git log → View history git show [SHA] → View specific commit git diff branchA...branchB → Compare branches 7. Temporary Work (Stash) git stash → Save changes temporarily git stash pop → Restore changes git stash list → View saved states 8. Undo & Rewrite git reset --hard [commit] → Reset project git rebase [branch] → Reapply commits Git is not about memorizing commands. It’s about understanding when and why to use them. If you master these… you’ll handle 90% of real-world Git tasks confidently. Comment “GIT” if you want the full PDF cheat sheet. If this feels like your journey, you’re not alone. If you want to grow on LinkedIn, follow ❤️me Narendra Kushwaha. and DM me. I’ll guide you on the right path for 2026, based on my journey of building a 7K+ LinkedIn family in 7–8 months. #Git #VersionControl #Developers #Programming #SoftwareEngineering #Tech #CareerGrowth
To view or add a comment, sign in
-
🎯 Git Cheat Sheet for Developers: Commands You Need Every Day Git is the backbone of modern development. Master these essentials to streamline your workflow and collaborate like a pro. ⚡ Repository Basics git init – Initialize a new repo git clone <url> – Clone an existing repo git status – Check the current state of your repo git log – View commit history 🌿 Branching & Merging git branch – List branches git branch <name> – Create a new branch git checkout <branch> – Switch branches git merge <branch> – Merge changes 🔄 Daily Workflow git add <file> – Stage changes git commit -m "message" – Commit changes git pull – Fetch & merge remote changes git push – Send changes to remote 🌐 Working with Remote Repositories git remote -v – List remote repos git fetch – Get latest updates from remote git push origin <branch> – Push a branch ⚠️ Undo & Fix Mistakes git checkout -- <file> – Discard local changes git reset <commit> – Undo commits git revert <commit> – Revert changes safely 💾 Temporary Saves git stash – Save work temporarily git stash pop – Restore stashed changes 📝 Commit Messages & Config git config --global user.name "Name" – Set user name git config --global user.email "email@example.com" – Set email Use clear, descriptive messages for each commit #Git #GitHub #Programming #Developers #SoftwareDevelopment #CodingTips #VersionControl #DevWorkflow
To view or add a comment, sign in
-
-
Most developers use Git every day. But 90% only know 3 commands. Here's the complete cheat sheet they're missing. 😳 📌 Basics (jo sab ko pata hona chahiye) main → Default primary branch origin → Default upstream branch HEAD → Current branch pointer HEAD^ → Parent of HEAD HEAD~3 → Great grandparent of HEAD 🌿 Branches git branch --all → List all local and remote branches git checkout hotfix → Switch to existing branch git merge hotfix → Merge branch changes to main git log --graph --oneline → Visual branch history 🚀 Start to Work git init → Create a new local Git repo git clone → Copy a repo git pull → Fetch and update from remote git add [file] → Stage tracked/untracked files git commit → Save staged changes git push origin HEAD → Push local changes to origin ⚔️ Conflicts git diff → See specific local changes git diff --ours → Compare working tree with our branch git diff --theirs → Compare working tree with their branch 🛠️ Useful Tools git archive → Create a release tarball git cherry-pick [commit-id] → Pick any specific commit to your branch The 3 commands most developers don't use but should: → git log --graph --oneline → git cherry-pick → git diff --theirs Save this. Share with a junior dev who needs it. Follow Developers Street for more practical dev tips. 🌐 www.developersstreet.com 📞 +91 9412892908 . . . . #Git #GitHub #VersionControl #SoftwareEngineering #WebDevelopment #DevelopersStreet #CodingTips #TechCareers #FullStackDevelopment #DevOps
To view or add a comment, sign in
-
Today I explored some new Git commands — first amend, then squash, and finally cherry-pick 🚀 If you’re a developer and want a clean, professional workflow, these three are game changers 👇 --- 🔧 1. git commit --amend Used to modify your last commit. git commit --amend 👉 What you can do: - Fix a wrong commit message - Add files you forgot to include 📌 Example: You committed but forgot one file → just add it and run amend. No extra commit needed. ⚠️ Note: Avoid using this after pushing to remote (it rewrites history). --- 🧩 2. git merge --squash Used to combine all commits from a branch into one clean commit. git checkout main git merge --squash feature-login git commit -m "Implement login feature" 👉 What happens: - All commits from "feature-login" → merged as a single commit into "main" 📌 Why it’s useful: - Keeps commit history clean - Makes PRs easy to review - Removes messy “fix”, “update”, “try again” commits --- 🍒 3. git cherry-pick Used to take a specific commit from another branch. git cherry-pick <commit-hash> 👉 Use case: - You fixed a bug in one branch and want the same fix in another branch - No need to merge the whole branch --- 💡 Simple way to remember: - Amend → Fix last commit - Squash → Combine commits - Cherry-pick → Copy one commit --- These small Git commands can seriously improve your workflow and make your project history look clean and professional ✨ If you’re not using them yet, give them a try! #git #github #softwareengineering #webdevelopment #developer #coding
To view or add a comment, sign in
-
-
Ever been confused between git pull and git fetch? I certainly was when I first started exploring Git. Both commands seem like they bring updates from a remote repository to your local machine, right? But understanding their subtle differences is key to a smoother Git workflow and avoiding unexpected merge conflicts. Here's a quick breakdown of what makes them distinct: - git fetch is like peeking at the remote repository without actually changing your local work. It downloads new commits, branches, and tags from the remote, updating your local remote-tracking branches (like origin/main). - Crucially, git fetch does not modify your local working branch (e.g., your main branch). Your current code stays exactly the same. It just lets you know what's available. - You can then inspect these fetched changes before integrating them. For example, you can compare your local main with origin/main using git diff main origin/main. - git pull is a shortcut that performs two operations: first, it runs git fetch, and then it automatically merges the fetched changes into your current local branch. - This means if you're on your main branch and run git pull origin main, Git fetches changes from origin/main and immediately tries to merge them into your local main. - While convenient, git pull can sometimes merge changes you haven't reviewed, potentially causing unexpected merge conflicts directly in your working branch. Using git fetch first gives you more control. Knowing when to use which has saved me a few headaches and helped me stay on top of my project's changes. What's your go-to Git command for staying updated? #Git #VersionControl #DeveloperTips #PythonDeveloper #FresherDev
To view or add a comment, sign in
-
🧠 TIL: git update-index --skip-worktree - a tiny git flag that made my dev loop so much cleaner. Every project has those files - the ones that are tracked in the repo, but you need to tweak locally just to get a sane dev experience. For me today, it was two BullMQ processor files that spin up cron jobs (heartbeats, cache clearers) on every boot. Great in staging/prod. Annoying as heck when I'm just trying to debug something unrelated on my laptop. The catch: they're tracked files. So .gitignore doesn't help. .git/info/exclude doesn't help. The moment I comment out a scheduler to quiet things down, my git status lights up - and one stray git add . away from shipping a broken commit. The usual workaround is stash / pop - and it's genuinely painful: Before every branch switch → git stash After switching → git stash pop Forget once → you lose your local tweaks or hit merge conflicts on your own stash Multiple local tweaks across multiple files = a growing stash stack you have to babysit git status still nags you until you stash And good luck if you want to commit other changes without accidentally including these One line fixes all of that: git update-index --skip-worktree path/to/file Now git pretends the file matches the index. No more noise in status, no accidental add, no stash dance. Your local edits just… stay local. Forever. Silently. Undo is equally simple, whenever you want: git update-index --no-skip-worktree path/to/file One caveat worth knowing: if upstream ever changes that file, you'll need to --no-skip-worktree, stash, pull, and re-flag. But for files that rarely change upstream, it's a massive quality-of-life win. If you've ever muttered "why is this file showing up in my diff AGAIN" - give this a try. 🙌 Found this via this great little writeup: https://lnkd.in/g_JqgPG7 #git #developerproductivity #softwareengineering #TIL
To view or add a comment, sign in
-
Master Git: From Your First Commit to Pro Workflows Whether you are writing your first line of code or managing complex systems, Git is the backbone of modern development. Mastering it doesn't just make you faster, it makes you a more reliable teammate. Here is a quick breakdown to help you level up your version control game: 🟢 Beginner: Building the Foundation Focus on the core cycle of saving and sharing your work. - git init & git clone: Start or copy a project. - git add & git commit: Capture your changes locally. - git push: Send your hard work to the cloud. 🟡 Intermediate: Collaboration & Cleanup Once you're comfortable, start managing different versions of your project. - Branching: Experiment without breaking the main code. - Merging: Combine your features seamlessly. - Stashing: Quickly hide unfinished work to fix a bug elsewhere. 🔴 Advanced: The Power User Tier For those tricky situations where you need precision and "time travel." - Cherry-pick: Grab a single specific commit from another branch. - Reflog: The ultimate safety net, find "lost" commits. - Bisect: Use binary search to find exactly which commit introduced a bug. Git isn't just a tool, it's a career-long skill. The better you understand your history, the more confident you become as a developer. What is the one Git command that has saved your life during a project? Let’s hear it in the comments! 👇 #Git #Command #Developer #Beginner #Advanced #JavaScript #Coding #DevOps #Workflow w3schools.com JavaScript Mastery GitHub JavaScript Developer GIT #Github #Linux #Programming
To view or add a comment, sign in
-
-
The amount of experienced engineers I know who do not know how to work with git, Seriously what's not pushing you to learn git It's not a senior engineer tool, It's a "bread and butter" tool
I help agencies & businesses fix hacked, broken, or slow WordPress sites before traffic, trust, or revenue is lost | Malware removal & recovery | WordPress plugin author
Master Git: From Your First Commit to Pro Workflows Whether you are writing your first line of code or managing complex systems, Git is the backbone of modern development. Mastering it doesn't just make you faster, it makes you a more reliable teammate. Here is a quick breakdown to help you level up your version control game: 🟢 Beginner: Building the Foundation Focus on the core cycle of saving and sharing your work. - git init & git clone: Start or copy a project. - git add & git commit: Capture your changes locally. - git push: Send your hard work to the cloud. 🟡 Intermediate: Collaboration & Cleanup Once you're comfortable, start managing different versions of your project. - Branching: Experiment without breaking the main code. - Merging: Combine your features seamlessly. - Stashing: Quickly hide unfinished work to fix a bug elsewhere. 🔴 Advanced: The Power User Tier For those tricky situations where you need precision and "time travel." - Cherry-pick: Grab a single specific commit from another branch. - Reflog: The ultimate safety net, find "lost" commits. - Bisect: Use binary search to find exactly which commit introduced a bug. Git isn't just a tool, it's a career-long skill. The better you understand your history, the more confident you become as a developer. What is the one Git command that has saved your life during a project? Let’s hear it in the comments! 👇 #Git #Command #Developer #Beginner #Advanced #JavaScript #Coding #DevOps #Workflow w3schools.com JavaScript Mastery GitHub JavaScript Developer GIT #Github #Linux #Programming
To view or add a comment, sign in
-
-
𝐌𝐨𝐬𝐭 𝐝𝐞𝐯𝐞𝐥𝐨𝐩𝐞𝐫𝐬 𝐮𝐬𝐞 𝐆𝐢𝐭 𝐞𝐯𝐞𝐫𝐲 𝐬𝐢𝐧𝐠𝐥𝐞 𝐝𝐚𝐲 — 𝐛𝐮𝐭 𝐨𝐧𝐥𝐲 𝐚 𝐡𝐚𝐧𝐝𝐟𝐮𝐥 𝐚𝐜𝐭𝐮𝐚𝐥𝐥𝐲 𝐮𝐧𝐝𝐞𝐫𝐬𝐭𝐚𝐧𝐝 𝐰𝐡𝐚𝐭'𝐬 𝐡𝐚𝐩𝐩𝐞𝐧𝐢𝐧𝐠 𝐮𝐧𝐝𝐞𝐫 𝐭𝐡𝐞 𝐡𝐨𝐨𝐝. They know git add and git commit. But ask them about git revert HEAD~2 or git commit --amend and suddenly the room goes quiet. Here's what actually separates a junior dev from someone who looks confident in interviews and on the job: Understanding Git end to end. Not just pushing code - but knowing: → Why git revert keeps your history intact but git reset doesn't ? → When to use git commit -a vs staging files manually ? → How branching actually works — and why you should never code directly on master ? → The difference between local and remote repos (GitHub, GitLab, Bitbucket). → How to clone, pull branches, push branches — not just your main branch ?? → How git commit --amend lets you fix your last commit without creating a new one ?? Here's exactly what's inside: 𝗦𝗲𝘁𝘂𝗽 & 𝗜𝗻𝗶𝘁 → git config --global user.name / user.email → git init 𝗦𝘁𝗮𝗴𝗶𝗻𝗴 & 𝗖𝗼𝗺𝗺𝗶𝘁𝘀 → git add / git add --all → git commit -m / git commit -a -m → git status / git status --short → git log / git log --oneline 𝗕𝗿𝗮𝗻𝗰𝗵𝗶𝗻𝗴 → git branch / git branch -d → git checkout / git checkout -b → git merge 𝗚𝗶𝘁𝗛𝘂𝗯 & 𝗥𝗲𝗺𝗼𝘁𝗲 → git remote add origin → git push --set-upstream origin master → git push origin / git pull origin → git clone / git branch -a / git branch -r 𝗨𝗻𝗱𝗼 𝗢𝗽𝗲𝗿𝗮𝘁𝗶𝗼𝗻𝘀 → git revert HEAD --no-edit → git revert HEAD~x → git reset / git reset commithash → git commit --amend -m
To view or add a comment, sign in
-
𝐘𝐨𝐮 𝐧𝐞𝐞𝐝 𝐬𝐨𝐦𝐞 𝐛𝐚𝐬𝐢𝐜 𝐮𝐧𝐝𝐞𝐫𝐬𝐭𝐚𝐧𝐝𝐢𝐧𝐠 𝐨𝐟 𝐆𝐢𝐭 𝐭𝐨 𝐠𝐞𝐭 𝐢𝐭 𝐫𝐢𝐠𝐡𝐭. Let me tell you how: Git a powerful tool software developers use to track changes in their code over time. Imagine it like a magic notebook for your code, keeping a history of everything you've done. 𝐇𝐞𝐫𝐞'𝐬 𝐰𝐡𝐲 𝐆𝐢𝐭 𝐢𝐬 𝐚𝐰𝐞𝐬𝐨𝐦𝐞, 𝐕𝐞𝐫𝐬𝐢𝐨𝐧 𝐜𝐨𝐧𝐭𝐫𝐨𝐥: Git lets you rewind and see older versions of your code if needed. 𝐂𝐨𝐥𝐥𝐚𝐛𝐨𝐫𝐚𝐭𝐢𝐨𝐧: Git allows multiple developers to work on the same codebase without stepping on each other's toes. 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲: Git protects your code from accidental or malicious changes. You can always revert back to a stable version if something goes wrong. 𝐍𝐨𝐰, 𝐥𝐞𝐭'𝐬 𝐮𝐧𝐥𝐨𝐜𝐤 𝐬𝐨𝐦𝐞 𝐞𝐬𝐬𝐞𝐧𝐭𝐢𝐚𝐥 𝐆𝐢𝐭 𝐜𝐨𝐦𝐦𝐚𝐧𝐝𝐬 𝐭𝐨 𝐧𝐚𝐯𝐢𝐠𝐚𝐭𝐞 𝐭𝐡𝐢𝐬 𝐦𝐚𝐠𝐢𝐜𝐚𝐥 𝐧𝐨𝐭𝐞𝐛𝐨𝐨𝐤: 𝐠𝐢𝐭 𝐚𝐝𝐝 : Stage changes to tracked and untracked files 𝐠𝐢𝐭 𝐝𝐢𝐟𝐟 : See specific local changes. Use -name- only to see filenames 𝐠𝐢𝐭 𝐜𝐨𝐦𝐦𝐢𝐭 : Create a new commit with changes previously added 𝐠𝐢𝐭 𝐬𝐭𝐚𝐬𝐡 : Save modified and staged changes 𝐠𝐢𝐭 𝐫𝐞𝐦𝐨𝐭𝐞-𝐯 :View all config remotes 𝐠𝐢𝐭 𝐟𝐞𝐭𝐜𝐡 : Fetch changes from remote repository 𝐠𝐢𝐭 𝐩𝐮𝐬𝐡 : Send changes to your config remote repository 𝐠𝐢𝐭 𝐜𝐥𝐨𝐧𝐞 : Clone a git repo to your local computer 𝐠𝐢𝐭 𝐩𝐮𝐥𝐥 : Fetch and merge changes from a remote repository 𝐠𝐢𝐭 𝐬𝐭𝐚𝐭𝐮𝐬 : See a summary of local changes, remote commits and untracked files 𝐠𝐢𝐭 𝐛𝐫𝐚𝐧𝐜𝐡 --𝐚𝐥𝐥 : List all local and remote branches 𝐠𝐢𝐭 𝐩𝐮𝐬𝐡 𝐨𝐫𝐢𝐠𝐢𝐧 𝐇𝐄𝐀𝐃 : Push commits located at the HEAD of your repo to the origin repo 𝐠𝐢𝐭 𝐥𝐨𝐠 : Shows the commit history for the currently active branch These are just a few powerful commands to get you started with Git. As you explore further, you'll discover even more ways to manage your code effectively! #softwareengineering #interviewtips #programming #mentorship #careertips #coding #guidance #learning #design #architecture #softwaredevelopment
To view or add a comment, sign in
-
More from this author
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development