Git Advanced Commands & Concepts for DevOps

🚀 DevOps Journey – Day 15 / 100 Diving deeper into Git advanced commands & concepts 🔥 🔹 Tracking & Status: • git add * → Track normal files • git add . → Track all (including hidden files) • git status → Check current changes 🔹 Removing Files: • git rm --cached file → Remove file from staging but keep in system 🔹 Git Configuration: • git config --global user.name "username" • git config --global user.email "mailid" 🔹 Logs & History: • git log --oneline → Short history • git log --follow --all file → Track file history • git log -p file → Show detailed changes 🔹 Modifying Commits: • git commit --amend -m "new message" • git commit --amend --author="user <email>" 🔹 Important Concepts: 📌 .gitignore → Used to ignore unwanted files (logs, temp, builds) 🔹 Reset & Recovery: • git reset --hard HEAD~1 → Delete last commit (danger ⚠️) • git reset --soft HEAD~1 → Undo commit but keep changes • git reflog → Recover lost commits 🔹 Advanced: • git cherry-pick <commit_id> → Apply specific commit 💡 Pro Tip: Always use --soft reset when learning. --hard can permanently delete work if not careful! Consistency is the key 🔑 Keep learning Git → Become DevOps Ready 💪 #DevOps #Git #Linux #VersionControl #100DaysOfDevOps #LearningJourney #Automation #Cloud #selflearning #flm

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories