Setting Up Git and Core Commands for DevOps

𝐃𝐀𝐘 𝟎𝟒 — 𝐆𝐞𝐭𝐭𝐢𝐧𝐠 𝐒𝐭𝐚𝐫𝐭𝐞𝐝 𝐰𝐢𝐭𝐡 𝐆𝐢𝐭 𝐒𝐞𝐭𝐮𝐩 𝐚𝐧𝐝 𝐂𝐨𝐫𝐞 𝐂𝐨𝐦𝐦𝐚𝐧𝐝𝐬 Yesterday, I introduced Git and why it’s a crucial part of DevOps workflows. Today, let’s talk about how to set it up and understand the key components that make it work. 𝐒𝐞𝐭𝐭𝐢𝐧𝐠 𝐔𝐩 𝐆𝐢𝐭 After installing Git, the first thing to do is set your global identity , this helps Git know who’s making each change. 𝐠𝐢𝐭 𝐜𝐨𝐧𝐟𝐢𝐠 --𝐠𝐥𝐨𝐛𝐚𝐥 𝐮𝐬𝐞𝐫.𝐧𝐚𝐦𝐞 "𝐘𝐨𝐮𝐫 𝐍𝐚𝐦𝐞" example: git config --global user.email "you@example.com" 𝐘𝐨𝐮 𝐜𝐚𝐧 𝐜𝐨𝐧𝐟𝐢𝐫𝐦 𝐲𝐨𝐮𝐫 𝐜𝐨𝐧𝐟𝐢𝐠𝐮𝐫𝐚𝐭𝐢𝐨𝐧 𝐰𝐢𝐭𝐡: 𝐠𝐢𝐭 𝐜𝐨𝐧𝐟𝐢𝐠 --𝐥𝐢𝐬𝐭 Important Sections of Git 𝐑𝐞𝐩𝐨𝐬𝐢𝐭𝐨𝐫𝐲 (𝐑𝐞𝐩𝐨) – This is where your project lives. You can create one locally using: 𝐠𝐢𝐭 𝐢𝐧𝐢𝐭 𝐖𝐨𝐫𝐤𝐢𝐧𝐠 𝐃𝐢𝐫𝐞𝐜𝐭𝐨𝐫𝐲 – The actual files you’re editing. Staging Area (Index) – Where changes are reviewed before committing. Add files to staging with: 𝐠𝐢𝐭 𝐚𝐝𝐝 [𝐟𝐢𝐥𝐞] 𝐂𝐨𝐦𝐦𝐢𝐭 – A snapshot of your staged changes. 𝐠𝐢𝐭 𝐜𝐨𝐦𝐦𝐢𝐭 -𝐦 "𝐜𝐨𝐦𝐦𝐢𝐭 𝐦𝐞𝐬𝐬𝐚𝐠𝐞" 𝐑𝐞𝐦𝐨𝐭𝐞 𝐑𝐞𝐩𝐨𝐬𝐢𝐭𝐨𝐫𝐲 – The shared version stored online (e.g., GitHub). 𝐠𝐢𝐭 𝐫𝐞𝐦𝐨𝐭𝐞 𝐚𝐝𝐝 𝐨𝐫𝐢𝐠𝐢𝐧 [𝐫𝐞𝐩𝐨-𝐮𝐫𝐥] 𝐠𝐢𝐭 𝐩𝐮𝐬𝐡 𝐨𝐫𝐢𝐠𝐢𝐧 𝐦𝐚𝐢𝐧 Understanding these parts will help you move from basic version control to efficient collaboration — which is the heartbeat of DevOps. #DevOps #Git #VersionControl #LearningJourney #Day6 #TechTools

To view or add a comment, sign in

Explore content categories