🚀 Day 23 of #90DaysOfDevOps Today, I leveled up from simple commits to the most powerful concept in Git: Branching & GitHub Workflows. 🌿 Isolation is key in DevOps💻—you never want to experiment on your production-ready code. Today, I mastered how to keep the "Source of Truth" safe while building new features. What I practiced: ✅ Feature Branching: Created feature-1 and feature-2 to work on updates without breaking the main branch. ✅The Modern Switch: Transitioned from git checkout to git switch—the cleaner, dedicated way to navigate between branches. ✅Remote Architecture: Finally demystified the relationship between Origin (my personal fork) and Upstream (the original source). ✅ Syncing Workflows: Learned the "Fetch + Merge" dance to keep my local environment perfectly aligned with the original repository. 💯 Key takeaway: Understanding the difference between git fetch and git pull is a game-changer. Fetching gives you that "buffer zone" to review changes before they merge into your local work, ensuring a conflict-free and stable pipeline. ⚡ #90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Git #GitHub #Linux #OpenSource #LearningInPublic #CloudComputing
Mastering Git Branching & GitHub Workflows with Shubham
More Relevant Posts
-
💡 A Small Git Problem I Solved Today While pushing my project to GitHub today, I encountered an error : 😬 “Updates were rejected because the remote contains work that you do not have locally.” At first, I wasn’t sure why this happened. After exploring the issue, I learned that the remote repository already had commits (like a README file), which caused a conflict with my local repository. To resolve it, I used: git pull origin main --allow-unrelated-histories This helped me merge the histories and successfully push my code. Every small issue like this teaches something new 😊. Today’s lesson: understanding how Git manages different commit histories. #Git #GitHub #Debugging #LearningInPublic #WebDevelopment
To view or add a comment, sign in
-
I forgot to push to GitLab for three weeks. Switched machines, kept working on GitHub, and only noticed when I tried to clone from the homelab and got a repo that was 47 commits behind. My first fix was a pre-push hook. The hook tried to run git push to GitLab from inside git push to GitHub. That's how I learned that infinite recursion applies to git hooks too. There's a better way that requires zero scripts: git remote set-url --add --push origin https://lnkd.in/gBktpWyn git remote set-url --add --push origin http://gitlab.homelab/user/repo.git That's it. git push now sends to both. One command, nothing to remember. What happens when GitLab is unreachable (like from the corporate laptop): → GitHub ✅ → GitLab ⚠️ fails gracefully — push still succeeds to GitHub GitLab catches up next time I'm home. The 47-commit gap doesn't happen again. The hook that caused infinite recursion? Deleted. If you're writing a shell script to work around a git limitation, check the man page first. The feature is probably already there. #Git #DevOps #RemoteWork #GitHub
To view or add a comment, sign in
-
The first thing I do when starting a new project is initialize Git and create a repository on Github, Gitlab, or Codeberg. No matter the size of your project, even if it's just a couple of code files for an experiment and you're the only one working on it, I recommend doing it in a version control system. Git allows you to add new lines and remove old lines without worrying about losing anything valuable in your files. You can view the change history and revert to a previous version at any time. If you haven't used it yet, there's a great guide (https://lnkd.in/ez6USXvq) that will introduce you to the basic commands and get you up to speed on workflows. Every project of mine starts with these commands in the console: ``` git init git add . git commit -m 'Init' git remote add origin ... git push -u origin master ``` #VCS #Git #Repository #Github #Gitlab #Codeberg
To view or add a comment, sign in
-
-
Never Google "how to undo a git commit" again. 🛑💻 Whether you’re a junior dev just starting out or a senior engineer who still triple-checks their syntax, Git is your daily driver. Here are the 12 absolute essential commands you need to master to navigate your repositories like a pro. Pro Tip: Always run git status before you commit. Trust me, it saves lives. 😉 🔖 Hit BOOKMARK to keep this cheat sheet handy at your desk! 🚀 Share this with a friend who is learning to code! #LearnToCode #CodingBootcamp #Git #GitHub #TechTips
To view or add a comment, sign in
-
-
If you've been wanting to learn Git and GitHub but didn't know where to start, here's a beginner friendly guide that covers the basics. What's inside: What Git and GitHub actually are How to install and configure Git Step by step from your first commit to pushing code to GitHub The daily workflow developers follow Clone vs pull and when to use each Commands cheat sheet and best practices Also sharing this video that explains it really well if you prefer watching: https://lnkd.in/g8pKvBDX Hope someone finds this useful. Feel free to save or share. #Git #GitHub #VersionControl #LearnToCode #TechForBeginners #SoftwareDevelopment #KnowledgeSharing
To view or add a comment, sign in
-
Save this post for future use! 📌 Git commands can be confusing. One wrong command and everything feels broken. I've compiled the most useful Git commands in one image: ✅ Basic commands you'll use daily ✅ Branching & merging made simple ✅ Fixes for common mistakes Keep this handy. Your terminal will thank you later. Save, share, or screenshot it! I love to connect with devs who build, break, and learn, just like me. Let's grow together! #git #github #webdev #codingtips #developertools
To view or add a comment, sign in
-
-
When Git finally makes sense, everything in your development workflow starts feeling easier. A lot of people find GitHub confusing at first, but once you understand the basics, eveerything becomes much more organized. Here's the simplest way to think about it: - Repository → your project workspace Commit → a saved snapshot of your progress Brancha safe parallel version for testing changes - Merge→ combining updates from different branches Push / Pull syncing local and remote code Git commands every beginner should know "git init" → create a new repository "git clone <url>" → copy an existing repo to your system "git status" → check modified files "git add." stage all changes "git commit-m "message" → save your work with a note "git push"→ upload local changes "git pull" fetch the latest updateS "git branch" view available branches "git checkout -b dev"→create and switch to a new branch "git merge dev" -merge branch changes Practical Git habits that save time - Don't run commands blindly-understand what each one does Avoid working directly on "main'", use branches Keep commit messages clear and meaningful Always run "git status" before committing - Pull latest changes before pushing your code Small Git habits like these Can save hours of debuggingand confusion later. If this made Git simpler for you, repost it so it can heIp another developer too. Save this as a quick Git cheat sheet for youir practice sessions. #git #github #devops #linux #Git #gitlabs
To view or add a comment, sign in
-
Once I understood the core commands, everything changed, here is the GitHub Crash Course for you ....... . . If you're still stuck on "how to use GitHub properly"? Here's a simple breakdown that helped me (and will help you too): - Repository = Project folder (local or remote) - Commit = Save a snapshot of your changes - Branch - Parallel version of your project - Merge = Combine branches - Clone / Push/Pull = Sync local and remote repos Most Useful Git Commands (with purpose): git init: # Start a new Git repo git clone <url>: # Copy repo to your local system git status: # See current changes git add.: # Stage all files for commit git commit -m "msg": # Save changes with message git push: # Upload changes to GitHub git pull: # Fetch latest from GitHüb git branch: # List branches git checkout -b dev: # Create & switch to new branch git merge dev: # Merge dev into main Connect Swadesh Kumar for more such content Repost it to share in your network Save it if you don't wanna miss it Comment "GitHub" & I'll DM it to you directly. 👇Bonus Tips : ✅ Always write meaningful commit messages ✅ Never push directly to main in a team project ✅ Use .gitignore to avoid uploading junk files
To view or add a comment, sign in
-
Once I understood the core commands, everything changed, here is the GitHub Crash Course for you ....... If you're still stuck on "how to use GitHub properly"? Here's a simple breakdown that helped me (and will help you too): - Repository = Project folder (local or remote) - Commit = Save a snapshot of your changes - Branch - Parallel version of your project - Merge = Combine branches - Clone / Push/Pull = Sync local and remote repos Most Useful Git Commands (with purpose): git init: # Start a new Git repo git clone <url>: # Copy repo to your local system git status: # See current changes git add.: # Stage all files for commit git commit -m "msg": # Save changes with message git push: # Upload changes to GitHub git pull: # Fetch latest from GitHüb git branch: # List branches git checkout -b dev: # Create & switch to new branch git merge dev: # Merge dev into main Connect Vishakha Singhal ❤️ Repost it to share in your network Save it if you don't wanna miss it Comment "GitHub" & I'll DM it to you directly. 👇Bonus Tips : ✅ Always write meaningful commit messages ✅ Never push directly to main in a team project ✅ Use .gitignore to avoid uploading junk files
To view or add a comment, sign in
-
Once I understood the core commands, everything changed, here is the GitHub Crash Course for you ....... If you're still stuck on "how to use GitHub properly"? Here's a simple breakdown that helped me (and will help you too): - Repository = Project folder (local or remote) - Commit = Save a snapshot of your changes - Branch - Parallel version of your project - Merge = Combine branches - Clone / Push/Pull = Sync local and remote repos Most Useful Git Commands (with purpose): git init: # Start a new Git repo git clone <url>: # Copy repo to your local system git status: # See current changes git add.: # Stage all files for commit git commit -m "msg": # Save changes with message git push: # Upload changes to GitHub git pull: # Fetch latest from GitHüb git branch: # List branches git checkout -b dev: # Create & switch to new branch git merge dev: # Merge dev into main Connect Vishakha Singhal ❤️ Repost it to share in your network Save it if you don't wanna miss it Comment "GitHub" & I'll DM it to you directly. 👇Bonus Tips : ✅ Always write meaningful commit messages ✅ Never push directly to main in a team project ✅ Use .gitignore to avoid uploading junk files
To view or add a comment, sign in
Explore related topics
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