Day 31/100: Time Traveling with Git – Basic Versioning ⏳ Today’s Focus: Yesterday, I learned how to save my work using git commit. But what happens when you actually need to use those saved snapshots? Today, I dove into Basic Versioning in Git to understand how to read project history and navigate between different versions of my code. 🧠 The Core Concept: The Commit Hash Every time you make a commit in Git, it generates a unique 40-character alphanumeric ID called a SHA-1 hash (e.g., a1b2c3d...). This hash is the exact coordinates of that specific version of your project in time! 🛠️ The Commands I Mastered: I practiced exploring my repository's history and moving through time: git log: The ultimate project diary. This command lists out the entire timeline of commits, showing who made the change, when they made it, the commit message, and that all-important commit hash. git log --oneline: A cleaner, condensed version of the log that makes it much easier to read when you have dozens of commits. git show [commit-hash]: Zooming in on a specific moment. This shows me exactly which lines of code were added or deleted in that particular commit. git checkout [commit-hash]: The time machine! Running this command changes the files in my working directory to look exactly as they did at that moment in the past. Why It Matters: In a DevOps or development environment, code breaks. It is inevitable. Versioning means that if a new script or application update crashes the system, I don't have to panic or try to remember what I changed. I can simply look at the git log and safely roll the project back to the last known working state. It is the ultimate "undo" button! 🔄 #100DaysOfDevOps #100DaysOfCode #Git #VersionControl #Linux #SysAdmin #DevOpsEngineer #TechJourney #DailyProgress #CloudComputing #CodingLife
Mastering Git Versioning with Commit Hash
More Relevant Posts
-
My Small but Powerful Workflow Upgrade This month marks 20 years of Git — the version control system that quietly powers nearly every developer’s daily work. Huge thanks to Linus Torvalds for creating it back in 2005. What began as a practical fix for the Linux kernel has become an essential part of modern software development. 🙌 This milestone got me reflecting on my own Git journey. I used to live entirely in the terminal for version control. Then a senior developer at my organization introduced me to VS Code’s built-in Source Control panel (the Git icon on the sidebar). And it added exactly the layer of safety I didn’t know I was missing — especially when pushing changes. Now my daily flow is more intentional and mindful: ✅ Open the Source Control view ✅ Instantly see every changed line with clear visual highlighting (added/removed) ✅ Review the code one more time in the beautiful side-by-side diff ✅ Stage only the exact hunks or selected lines I want — not the whole file ✅ Write a clean commit message and push This visual review step gives me that extra security and safety — like a quick second pair of eyes catching anything I might have missed in the rush. I’m not saying the GUI is always better than the CLI. Far from it. For complex tasks like interactive rebasing, advanced scripting, cherry-picking, or heavy history rewriting, the CLI is still far more powerful and flexible — and many experienced developers rightly prefer it for those scenarios. But for the everyday cycle of reviewing changes → selective staging → thoughtful commits → pushing, VS Code Source Control has become my preferred safety net. It keeps me more careful without slowing me down. Grateful to my senior for teaching me this habit — and to Linus for giving the world Git in the first place. Small shifts like this really do improve code quality and peace of mind. What about you? Do you mix VS Code Source Control for daily visual reviews with CLI for power-user tasks? Or do you have a favorite tip (hunk staging, GitLens, inline diffs)? Drop your workflow or thoughts in the comments 👇 — especially on this 20-year milestone! #Git #VSCode #SourceControl #DeveloperTips #VersionControl #Git20Years #DevLife #LearningJourney
To view or add a comment, sign in
-
Day 32/100: Creating Parallel Universes – Git Branching & Merging 🌿 Today’s Focus: Up until now, all my Git commits have been on a single, straight timeline. But what if I want to experiment with a risky new feature or write a new automation script without breaking the working production code? Today, I learned the solution: Git Branching! 🧠 What is a Branch? A branch in Git is essentially an independent line of development. It allows you to create a "parallel universe" of your project. You can build, break, and test things in this isolated branch, and the main project remains completely untouched. 🛠️ The Core Workflow I Practiced: git branch: Used to list all the branches in my repository and see which one I am currently working on. git checkout -b [branch-name]: The ultimate shortcut command! This creates a brand new branch and instantly switches me over to it. I used this to create a safe space for testing a new script. git merge [branch-name]: The moment of truth. Once my experimental feature was working perfectly, I switched back to the main branch and used this command to seamlessly combine my new code into the primary project timeline. Why It Matters: In a DevOps team, you never push unverified code directly to the main branch. Branching allows dozens of engineers to work on the exact same project simultaneously, completely isolated from one another, before safely merging their features together. It is the backbone of modern team collaboration! 🤝 #100DaysOfDevOps #100DaysOfCode #Git #VersionControl #Linux #Branching #SysAdmin #DevOpsEngineer #TechJourney #DailyProgress #CloudComputing
To view or add a comment, sign in
-
Git is more than just a tool — it's the heartbeat of every DevOps pipeline. 💓 After covering Linux fundamentals, I went deep on Git. Not just reading docs — I practiced 23 essential commands hands-on, documenting every terminal output and GitHub workflow along the way. 🛠️ 📚 What's inside the hands-on guide? 1️⃣ Foundation — Installation on Ubuntu + identity setup with git config. 2️⃣ Core Workflow — Mastering the flow: Working Directory → Staging → Local Repo → Remote. 3️⃣ Branching — Managing dev and prod branches like a professional environment. 4️⃣ Recovery Tools — git stash for work-in-progress and git cherry-pick for surgical fixes. 5️⃣ History Control — Knowing exactly when to use --soft vs --hard reset. 💡 3 things I learned by intentionally breaking Git: The Golden Rule: 1. Always pull before you push. I triggered a push rejection on purpose — by adding a file directly on GitHub — and resolved the conflict step by step. That 10 minutes taught me more than hours of reading. 2. Visualize the tree. git log --oneline --graph is your best friend. If you can’t see the branch structure, you don’t truly control the flow. 3. Commit with intent. Small, frequent commits with clear messages beat one massive "final update" every time — especially when something breaks and you need to roll back. I'm sharing the wealth! 👇 Attached major command reference guide with real terminal screenshots and GitHub workflow documentation. I hope this helps anyone else on the DevOps path. #Git #GitHub #DevOps #VersionControl #Linux #CloudComputing #LearningInPublic #Automation #SoftwareEngineering #TechSkills
To view or add a comment, sign in
-
🚀 Git Branching Strategies – The Backbone of Clean & Scalable Development In any DevOps or software development lifecycle, having the right Git branching strategy is crucial for maintaining code quality, enabling collaboration, and ensuring smooth deployments. Here are some of the most important branching strategies every developer should know 👇 🔹 1. Git Flow A structured approach with dedicated branches like main, develop, feature, release, and hotfix. ✔ Best for large teams & release-based projects 🔹 2. Feature Branching Each feature is developed in its own branch and merged back after completion. ✔ Keeps main branch stable ✔ Encourages parallel development 🔹 3. Trunk-Based Development Developers commit frequently to a single branch (main/trunk). ✔ Ideal for CI/CD environments ✔ Faster integrations, fewer merge conflicts 🔹 4. Release Branching Separate branches created for preparing production releases. ✔ Stabilizes code before deployment ✔ Allows ongoing development in parallel 🔹 5. Forking Workflow Common in open-source projects where contributors fork repositories. ✔ Enhances security and collaboration #AWS #CloudDevOPs #Linux #CI/CD #Docker #EKS #Kubernetes #Terraform #Jenkins #Harness #Monitoring Tools #Git #Github #python
To view or add a comment, sign in
-
-
Today I will talk about two very important and crucial things in tech industry, especially in software industry. Those are: 1. Git 2. GitHub Many of us especially beginners have a lot of confusion and misunderstanding about them. I will try to explain them in simple and easy way as I can. Let begin: 1. Git: As we know git is a version control system. We can monitor our project workflow throw it. This is a very popular tool to us. The interesting fact is git was also created at 2005 by Linus Torvalds, the father of Linux Kernel. It is an open-source tool. Before that the developer of Linux Kernel use a system called BitKeeper. Goals behind develop git was: - Speed - Simple design - Strong support for non-linear development - Fully distributed - Able to handle large project efficiently Though there are other tools like subversion, but it is still number one choice to the tech gigs. 2. GitHub: It is a cloud source management service platform. According to GitHub documentation page, GitHub Inc was formed n 2007 by Chris Wanstrath, P. J. Hyett, Tom Preston and Scott Chaocon and launched GitHub in February 2008. Now its own by Microsoft. In June 2018, Microsoft announced its acquisition of GitHub. After that some of the open-source users was worried about the free uses of GitHub. It primary role is store code and docs. But there are some other features it provides nowadays. These are: - code review - project management - continuous integration unit testing. - GitHub actions - associated web page Though there are other platforms like Bitbucket, GitLab but none of them are not popular and functional as GitHub. #Git #GitHub #DevOps #SWE
To view or add a comment, sign in
-
-
𝗗𝗮𝘆 𝟮𝟮 𝗼𝗳 𝗺𝘆 𝗗𝗲𝘃𝗢𝗽𝘀 𝗝𝗼𝘂𝗿𝗻𝗲𝘆 💻 Bringing code to life — cloned a Git repository to create a working copy for development 📥 𝗧𝗮𝘀𝗸: Clone Git Repository on Storage Server 𝗪𝗵𝗮𝘁 𝗜 𝗹𝗲𝗮𝗿𝗻𝗲𝗱 𝘁𝗼𝗱𝗮𝘆: • Difference between bare repository and working repository • How `git clone` creates a local working copy • Cloning repositories from local paths (not just GitHub) • Importance of using correct user permissions • Safe handling of shared repositories in production environments 𝗪𝗵𝗮𝘁 𝗜 𝗯𝘂𝗶𝗹𝘁 / 𝗽𝗿𝗮𝗰𝘁𝗶𝗰𝗲𝗱: • Logged into Storage Server (`ststor01`) as `natasha` • Verified existence of repository `/opt/games.git` • Created destination directory `/usr/src/kodekloudrepos` • Cloned repository using `git clone /opt/games.git` • Verified working copy using `git status` 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲𝘀: • Understanding local path-based cloning • Ensuring no permission or structure changes were made • Being careful to use the correct user (`natasha`) 𝗙𝗶𝘅 / 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴: • Learned that cloning from local repositories works the same as remote • Understood importance of maintaining repository integrity • Gained clarity on how working copies are used in development 𝗞𝗲𝘆 𝗧𝗮𝗸𝗲𝗮𝘄𝗮𝘆: Cloning is where development begins — it bridges the gap between a central repository and actual coding work. This felt like a real-world Git workflow setup 🚀 Do you mostly clone from local repos, GitHub, or enterprise tools like GitLab/Bitbucket? #Day22 #DevOps #Git #VersionControl #Linux #Automation #CloudComputing #AWS #DevOpsJourney #LearningInPublic #100DaysOfDevOps
To view or add a comment, sign in
-
-
The mental model that finally made Git click for me: A GitHub repository is just the remote version of your local project folder. git push sends your local files into that remote repo. That's it. Sounds obvious, but once it clicked, a lot of the confusing Git behavior started making sense. Two practical lessons I learned the hard way: 𝟭. 𝗖𝗿𝗲𝗮𝘁𝗲 𝘆𝗼𝘂𝗿 𝗚𝗶𝘁𝗛𝘂𝗯 𝗿𝗲𝗽𝗼 𝗲𝗺𝗽𝘁𝘆 𝗶𝗳 𝘆𝗼𝘂𝗿 𝗽𝗿𝗼𝗷𝗲𝗰𝘁 𝗮𝗹𝗿𝗲𝗮𝗱𝘆 𝗲𝘅𝗶𝘀𝘁𝘀 𝗹𝗼𝗰𝗮𝗹𝗹𝘆. If you initialize the GitHub repo with a README or .gitignore, GitHub creates its own starting history. Your local project has a different history. When you try to push, Git blocks it because the two histories don't match. Save yourself the headache & create the repo empty - let your local project be the source of truth. 𝟮. 𝗚𝗶𝘁𝗛𝘂𝗯 𝗻𝗼 𝗹𝗼𝗻𝗴𝗲𝗿 𝗮𝗰𝗰𝗲𝗽𝘁𝘀 𝘆𝗼𝘂𝗿 𝗮𝗰𝗰𝗼𝘂𝗻𝘁 𝗽𝗮𝘀𝘀𝘄𝗼𝗿𝗱 𝗶𝗻 𝘁𝗵𝗲 𝘁𝗲𝗿𝗺𝗶𝗻𝗮𝗹. For CLI access you need a Personal Access Token (PAT). Generate one in your GitHub settings and use that instead. Once you know this it takes two minutes. But if you don't, the error message sends you in circles. The bigger pattern I keep noticing: most errors have an architectural reason behind them. Find that reason and the fix becomes obvious. What's the Git thing that confused you the longest before it clicked? 👇 WHY DID IT TAKE ME SO LONG TO UNDERSTAND
To view or add a comment, sign in
-
Once I understood the core Git commands, everything changed. If you're still stuck on “how to use GitHub properly?” — this will simplify it for you: 🔹 Repository = Your project folder (local or remote) 🔹 Commit = A saved snapshot of your changes 🔹 Branch = A parallel version of your project 🔹 Merge = Combine different branches 🔹 Clone / Push / Pull = Sync between local & remote 💻 Most Useful Git Commands (with purpose): git init → Start a new repository git clone <url> → Copy a repo to your system git status → Check current changes git add . → Stage all files git commit -m "message" → Save your changes git push → Upload to GitHub git pull → Get latest updates git branch → View branches git checkout -b dev → Create & switch branch git merge dev → Merge branch into main Connect Kartik Kathuria for more stuff 😃 💡 Bonus Tips: ✅ Write meaningful commit messages ✅ Avoid pushing directly to main (in team projects) ✅ Use .gitignore to skip unnecessary files If this helped you, save it for later and share it with your network. #GitHub #Git #VersionControl #Programming #Developer #SoftwareEngineering #WebDevelopment #TechTips #LearnToCode #DevCommunity #CodingJourney #OpenSource #BuildInPublic #Upskill #TechCareer
To view or add a comment, sign in
-
🚀 Git & GitHub Cheatsheet for Developers 🔹 Why it matters: • Version control is your safety net 🛟 • Collaboration becomes seamless 🤝 • Track every change like a pro 📊 🔹 Essential Git Commands: • "git init" – Start a repo 🆕 • "git clone" – Copy a repo 📥 • "git add ." – Stage changes ➕ • "git commit -m "msg"" – Save changes 💾 • "git push" – Upload to GitHub 🚀 🔹 Branching Basics: • "git branch" – List branches 🌿 • "git checkout -b feature" – Create new branch 🔀 • "git merge" – Combine work 🔗 🔹 Pro Tips: • Write meaningful commit messages ✍️ • Pull before push to avoid conflicts ⚠️ • Keep branches clean and focused 🎯 💡 Master these basics and you’ll level up your dev workflow instantly! Source :- Respected owner ✨ Learn more from w3schools.com ✨ #Git #GitHub #WebDevelopment #CodingTips #Developers
To view or add a comment, sign in
-
🚀 Git & GitHub Cheatsheet for Developers 🔹 Why it matters: • Version control is your safety net 🛟 • Collaboration becomes seamless 🤝 • Track every change like a pro 📊 🔹 Essential Git Commands: • "git init" – Start a repo 🆕 • "git clone" – Copy a repo 📥 • "git add ." – Stage changes ➕ • "git commit -m "msg"" – Save changes 💾 • "git push" – Upload to GitHub 🚀 🔹 Branching Basics: • "git branch" – List branches 🌿 • "git checkout -b feature" – Create new branch 🔀 • "git merge" – Combine work 🔗 🔹 Pro Tips: • Write meaningful commit messages ✍️ • Pull before push to avoid conflicts ⚠️ • Keep branches clean and focused 🎯 💡 Master these basics and you’ll level up your dev workflow instantly! Source :- Respected owner ✨ Learn more from w3schools.com ✨ hashtag #Git hashtag #GitHub hashtag #WebDevelopment hashtag #CodingTips hashtag #Developers
Full Stack Developer (MERN) | React.js • Node.js • MongoDB • Javascript | 300+ DSA Problems Solved | Building Scalable Web Apps | Open to Software Engineer Roles
🚀 Git & GitHub Cheatsheet for Developers 🔹 Why it matters: • Version control is your safety net 🛟 • Collaboration becomes seamless 🤝 • Track every change like a pro 📊 🔹 Essential Git Commands: • "git init" – Start a repo 🆕 • "git clone" – Copy a repo 📥 • "git add ." – Stage changes ➕ • "git commit -m "msg"" – Save changes 💾 • "git push" – Upload to GitHub 🚀 🔹 Branching Basics: • "git branch" – List branches 🌿 • "git checkout -b feature" – Create new branch 🔀 • "git merge" – Combine work 🔗 🔹 Pro Tips: • Write meaningful commit messages ✍️ • Pull before push to avoid conflicts ⚠️ • Keep branches clean and focused 🎯 💡 Master these basics and you’ll level up your dev workflow instantly! Source :- Respected owner ✨ Learn more from w3schools.com ✨ #Git #GitHub #WebDevelopment #CodingTips #Developers
To view or add a comment, sign in
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