Master Git for DevOps Engineers and Developers

𝐆𝐢𝐭 𝐂𝐨𝐦𝐦𝐚𝐧𝐝𝐬 𝐄𝐯𝐞𝐫𝐲 𝐄𝐧𝐠𝐢𝐧𝐞𝐞𝐫 𝐒𝐡𝐨𝐮𝐥𝐝 𝐊𝐧𝐨𝐰 🚀 People rush into CI/CD, Docker, Kubernetes… but struggle with Git basics. If you want to work confidently in any tech team, Git is non-negotiable. Here’s a clean, practical Git cheat-sheet every developer & DevOps engineer should know 👇 ✔ 𝐠𝐢𝐭 𝐢𝐧𝐢𝐭 →  Create an empty Git repository or reinitialize an existing one ✔ 𝐠𝐢𝐭 𝐬𝐭𝐚𝐭𝐮𝐬 → Show the working tree status ✔ 𝐠𝐢𝐭 --𝐯𝐞𝐫𝐬𝐢𝐨𝐧 → Check the Git version ✔ 𝐠𝐢𝐭 𝐚𝐝𝐝 . →  Add files to the staging area ✔ 𝐠𝐢𝐭 𝐜𝐨𝐦𝐦𝐢𝐭 -𝐦 "𝐦𝐞𝐬𝐬𝐚𝐠𝐞" → Save your changes to the local repository ✔ 𝐠𝐢𝐭 𝐥𝐨𝐠 → See commit history ✔ 𝐠𝐢𝐭 𝐝𝐢𝐟𝐟 → Check what has changed before committing ✔ 𝐠𝐢𝐭 𝐩𝐮𝐬𝐡 → Send your changes to the remote repository ✔ 𝐠𝐢𝐭 𝐜𝐨𝐧𝐟𝐢𝐠 --𝐠𝐥𝐨𝐛𝐚𝐥 𝐮𝐬𝐞𝐫.𝐧𝐚𝐦𝐞 "𝐘𝐨𝐮𝐫 𝐍𝐚𝐦𝐞" → Sets the global username. ✔ 𝐠𝐢𝐭 𝐜𝐨𝐧𝐟𝐢𝐠 --𝐠𝐥𝐨𝐛𝐚𝐥 𝐮𝐬𝐞𝐫.𝐞𝐦𝐚𝐢𝐥 "𝐲𝐨𝐮𝐫𝐞𝐦𝐚𝐢𝐥@𝐞𝐱𝐚𝐦𝐩𝐥𝐞.𝐜𝐨𝐦"→ Sets the global email. ✔ 𝐠𝐢𝐭 𝐜𝐥𝐨𝐧𝐞 <𝐫𝐞𝐩𝐨𝐬𝐢𝐭𝐨𝐫𝐲_𝐮𝐫𝐥> → Creates a copy of a remote repository on your local machine. ✔ 𝐠𝐢𝐭 𝐜𝐥𝐞𝐚𝐧 -𝐧 → Shows a list of untracked files that will be removed. ✔ 𝐠𝐢𝐭 𝐜𝐥𝐞𝐚𝐧 -𝐟 → Removes untracked files from the working directory. ✔ 𝐠𝐢𝐭 𝐛𝐫𝐚𝐧𝐜𝐡 → List all local branches ✔ 𝐠𝐢𝐭 𝐛𝐫𝐚𝐧𝐜𝐡 𝐛𝐫𝐚𝐧𝐜𝐡-𝐧𝐚𝐦𝐞 → Create a new branch ✔ 𝐠𝐢𝐭 𝐜𝐡𝐞𝐜𝐤𝐨𝐮𝐭 𝐛𝐫𝐚𝐧𝐜𝐡-𝐧𝐚𝐦𝐞 → switches to another branch ✔ 𝐠𝐢𝐭 𝐜𝐡𝐞𝐜𝐤𝐨𝐮𝐭 -𝐛 𝐛𝐫𝐚𝐧𝐜𝐡-𝐧𝐚𝐦𝐞 → creates a branch and switches to it ✔ 𝐠𝐢𝐭 𝐦𝐞𝐫𝐠𝐞 𝐛𝐫𝐚𝐧𝐜𝐡-𝐧𝐚𝐦𝐞 → merges another branch into the current/master branch ✔ 𝐠𝐢𝐭 𝐛𝐫𝐚𝐧𝐜𝐡 -𝐝 𝐛𝐫𝐚𝐧𝐜𝐡-𝐧𝐚𝐦𝐞 → deletes a branch after the work is done  ✔ 𝐠𝐢𝐭 𝐫𝐞𝐬𝐞𝐭 → Used when you want to undo local changes. ✔ 𝐠𝐢𝐭 𝐫𝐞𝐯𝐞𝐫𝐭 → Safely undo a commit  ✔ 𝐠𝐢𝐭 𝐬𝐭𝐚𝐬𝐡 → Temporarily save work when you’re not ready to commit If you’re learning DevOps or working as a developer master Git before chasing advanced tools. #git #DevOps #CloudComputing #LearningInPublic #TechSkills #Beginners #ITCareer #Practice

To view or add a comment, sign in

Explore content categories