Day 30: Git Hard Reset & History Cleanup | #100DaysOfDevOps Worked on cleaning up a Git repository by removing unwanted test commits and resetting the commit history to a stable point. A hands-on task to understand how rewriting Git history works and why it’s important to maintain a clean and meaningful commit history in repositories. Used git reset --hard to move the branch back to a specific commit and git push --force to update the remote repository. 📌 Blog: https://lnkd.in/gu3GXDyx #DevOps #Git #VersionControl #Linux #100DaysOfDevOps
Git Reset & History Cleanup with Git
More Relevant Posts
-
Day 32: Git Rebase & Clean History | #100DaysOfDevOps Worked on rebasing a feature branch with the master branch in a Git repository to integrate the latest changes without creating a merge commit. A hands-on task to understand how Git rebase helps maintain a clean and linear commit history while preserving all feature branch work. Used git rebase master to replay commits from the feature branch on top of master, followed by a force push to update the remote repository. 📌 Blog: https://lnkd.in/gW5uYZbp #DevOps #Git #VersionControl #Linux #100DaysOfDevOps #GitRebase
To view or add a comment, sign in
-
Day 33: Resolving Git Merge Conflicts | #100DaysOfDevOps Worked on resolving a Git merge conflict while pushing changes to a shared repository. Faced a push rejection due to remote updates and learned how to properly sync changes before pushing. A practical task to understand how conflicts occur when multiple contributors modify the same file and how to resolve them manually without losing important data. Used git pull to fetch latest changes, fixed conflict markers in the file, corrected a typo ("Mooose" → "Mouse"), ensured all entries were included, and successfully pushed the changes after committing the resolution. 📌 Blog: https://lnkd.in/gtXkds5u #DevOps #Git #VersionControl #Linux #100DaysOfDevOps #GitConflicts
To view or add a comment, sign in
-
Day 25: Git Merge Branches | #100DaysOfDevOps Today I worked on creating and merging a branch in an existing Git repository on the storage server. Created a new branch nautilus from the master branch in /usr/src/kodekloudrepos/blog, added a new file, and merged the changes back into the master branch. A simple but essential task to understand how developers integrate feature changes into the main codebase efficiently using Git. 📌 Blog: https://lnkd.in/g4xjdJ7G #DevOps #Git #Linux #100DaysOfDevOps
To view or add a comment, sign in
-
⚡ DevOps Shortcuts I Use Daily (and can’t live without): 💻 Linux Terminal Ctrl + C → Stop current process Ctrl + Z → Pause process Ctrl + R → Search command history !! → Repeat last command 🐳 Docker docker ps → List running containers docker images → List images docker logs -f → Live logs docker exec -it /bin/bash → Access container ☸️ Kubernetes (kubectl) kubectl get pods → List pods kubectl describe pod → Detailed info kubectl logs → View logs kubectl apply -f → Deploy config 🌿 Git git status → Check changes git log --oneline → Compact history git checkout -b → New branch git pull origin main → Sync code Small shortcuts, big productivity boost 🚀 What are your go-to DevOps commands? #DevOps #Linux #Docker #Kubernetes #Git #Productivity #TechTips
To view or add a comment, sign in
-
Day 31: Git Stash Restore & Recovery | #100DaysOfDevOps Worked on restoring stashed changes in a Git repository and pushing them back to the remote repository. A hands-on task to understand how Git stash helps save in-progress work and how to recover specific changes when needed without affecting other work. Used git stash apply to restore a specific stash entry, followed by commit and push to update the repository. 📌 Blog: https://lnkd.in/gQvfnJQE #DevOps #Git #VersionControl #Linux #100DaysOfDevOps
To view or add a comment, sign in
-
Git Commands Every DevOps Engineer Should Know! Here's a visual guide to some essential Git commands that power your daily workflows: 1. git commit - Saves your changes with a message 2. git branch feature - Creates a new branch called "feature" 3. git checkout feature - Switches to the feature branch 4. git checkout main - Switches back to the main branch 5. git merge feature - Merges feature branch into main (Fast-forward!) 6. git revert HEAD - Undoes the last commit safely 7. git rebase main - Replays commits on top of another branch 8. git reset HEAD~1 - Moves the branch pointer back 9. git cherry-pick main - Applies a specific commit to current branch 10. git log - Shows the commit history with author and timestamps The visual Git graph shows how branches split, merge, and evolve. Understanding these commands helps you manage code efficiently in any DevOps pipeline. Which Git command do you use the most? #DevOps #Git #VersionControl #CI_CD #CloudNative #Linux #TechLearning
To view or add a comment, sign in
-
Day 30/100: Enter the Time Machine – Introduction to Git 🌳 Today’s Focus: For the past month, I've been deep in the Linux terminal managing servers, files, and permissions. Today, I took a massive step toward actual software development and collaboration by diving into Git, the world's most popular Version Control System (VCS)! 🧠 What exactly is Git? At its core, Git is like a time machine for your code. It tracks every single change made to a file or a project over time. Before Git, I used to save files like this: ❌ script.sh ❌ script_v2.sh ❌ https://lnkd.in/d6QdZdtw With Git, I just have one project folder, and the system intelligently remembers the entire history of edits, who made them, and exactly when they happened! 🛠️ The Core Workflow I Learned Today: I started by turning a regular directory into a Git repository and tracking my first files: git init: The magic command that initializes an empty Git repository in my project folder. git status: My new best friend. It acts as a radar, telling me which files have been modified, which are untracked, and what is ready to be saved. git add [file]: Moving my changed files into the "Staging Area" (getting them ready for a snapshot). git commit -m "Message": Taking the actual snapshot! This permanently records the staged changes into the project's timeline with a descriptive message. Why It Matters: Whether I am writing a basic Bash script or collaborating with 50 other engineers on a massive cloud application, Git is non-negotiable. It prevents us from overwriting each other's work and gives us a safe way to experiment (and easily roll back if things break!). 🚀 #100DaysOfDevOps #100DaysOfCode #Git #VersionControl #Linux #SysAdmin #DevOpsEngineer #TechJourney #DailyProgress #CloudComputing #CodingLife
To view or add a comment, sign in
-
🚀 POST 2 of 10 — Git Setup & Configuration Here’s a simple 3‑step Git setup I wish I’d known earlier 👇 ✅ Step 1 — Install Git Windows: Download from 👉 https://git-scm.com Mac: brew install git Linux: sudo apt install git Verify the install: git --version ✅ Step 2 — Tell Git who you are git config --global user.name "Your Name" git config --global user.email "you@email.com" ✅ Step 3 — Set up SSH for GitHub SSH lets you push code without typing your password every time 🔐 Generate your SSH key: ssh-keygen -t ed25519 -C "you@email.com" cat ~/.ssh/id_ed25519.pub 📋 Copy the output 👉 GitHub → Settings → SSH Keys → Paste Test the connection: ssh -T git@github.com You should see: “Hi YourUsername! You've successfully authenticated.” ✨ That’s it. One-time setup. After this, Git just works—quietly and reliably. #Git #GitHub #Programming #LearnToCode
To view or add a comment, sign in
-
If you're still switching branches to work on multiple features… there’s a better way. I learned this the hard way. When you're: - developing features in parallel - running multiple builds (Yocto / firmware) - or maintaining forks 👉 basic Git (add / commit / push) isn’t enough These 3 commands completely changed how I work. Not the usual Git tricks… 👉 the ones that actually matter in real projects Here they are 👇
To view or add a comment, sign in
-
Early in my career, I witnessed one of the biggest catastrophes that I’ll never forget. There was a shell script written to clean a workspace and clone multiple git repos. The idea was simple. Remove existing folders, recreate them, and clone fresh, while taking care of installation of the dependencies required. But it depended on being inside a specific directory. Because of a setup issue during sudo apt install, that directory never got created. The script didn’t check this. It just assumed it was in the right place. At some point it moved one level up using a relative path and then ran: rm -rf * Here is where things got bad. The shell script was not executing inside the expected folder. It was executing from the root directory /, which is basically the entire file system! It ended up deleting critical files and the system crashed, big-time!!! I was able to trace what happened and pointed it out. What stayed with me more than the bug though was the defensiveness during the review. That day I made a mental note to myself: Always take 100% responsibility for the things that can go wrong. Over the next few years, I tried to follow that. Own mistakes quickly. Make it safe for others to speak up. And never let ego get in the way of fixing something. Because taking ownership isn’t just about completing every single task by yourself. It’s about having the ability to own up to your mistakes, when things go wrong! :) #softwareengineering #linux #systems #coding
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