Yesterday I had to sync a branch from one Git repository into another repo , one of those tasks that sounds simple but needs precision. Added the external repo as a remote, fetched the branch, merged it into a one‑time sync branch, and pushed it for review. ```git remote add <remote-name><repo-url> git fetch <remote-name> git checkout -b one-time-sync git merge <remote-name>/<remote-branch> git push origin one-time-sync``` A neat reminder that Git is powerful when you understand remotes, not just branches. #Git #Devops
Syncing Git Branches with Precision
More Relevant Posts
-
🚀 GitLab Migration: A Story Between Old Repo & New Repo 😄 So I recently had to migrate projects from one GitLab to another… and honestly, it felt like shifting houses 🏠 🔹 Step 1: Packed everything git clone --mirror 👉 “Take EVERYTHING. Even things I forgot existed.” 🔹 Step 2: Moved to new place git push --mirror 👉 “Congrats, new GitLab… you now have my entire past.” 🔹 Step 3: Panic moment 😱 Error: “deny updating a hidden ref” 👉 Me: “WHAT DID I BREAK???” 👉 GitLab: “Relax… that’s just merge request stuff.” 🔹 Step 4: Trust issues 👉 Checked commits 👉 Checked branches 👉 Checked again… just in case 🔹 Step 5: Size mismatch 🤨 Old repo: 500 MB New repo: 480 MB 👉 Me: “WHERE ARE MY 20 MB???” 👉 Git: “Bro… I cleaned your mess.” 🔹 Reality check 💀 ❌ Members didn’t come ❌ Permissions didn’t come ❌ Pipelines didn’t come 👉 Basically moved house… but forgot the people 💡 Final lesson: If commits match → You’re safe If branches match → You’re happy If no errors → Don’t overthink 😄 #DevOps #GitLab #Migration #Git
To view or add a comment, sign in
-
Most developers use Git every day but can't explain how it actually works. Here's the complete workflow in one diagram. 🤯 📁 Workspace → Stage → Local Repo → Remote Repo Here's what each command actually does: git add → Moves files from Workspace to Stage (prepares for commit) git reset → Moves files back from Stage to Workspace (undo staging) git commit → Saves staged changes to your Local Repository git push → Sends commits from Local Repository to Remote Repository git fetch → Downloads changes from Remote to Local (does NOT merge) git merge → Merges fetched changes into your current branch git pull → git fetch + git merge combined in one command Remote Platforms: GitHub, GitLab, Bitbucket — they all work the same way. The most misunderstood command: git pull vs git fetch. git fetch = "show me what changed" (safe, no side effects) git pull = "get changes and apply them" (can cause conflicts) Always git fetch first on shared branches. Then review. Then merge. Follow Developers Street for more practical dev tips. 🌐 www.developersstreet.com 📞 +91 9412892908 . . . . #Git #GitHub #VersionControl #SoftwareEngineering #WebDevelopment #DevelopersStreet #CodingTips #TechCareers #DevOps #FullStackDevelopment
To view or add a comment, sign in
-
Git Workflow (At a Glance) 🚀 Most developers use Git daily, but many still struggle with the difference between the Staging Index and Local Repo, or when to Merge vs. Rebase. If you’re guessing your way through your terminal, you’re eventually going to break a production branch. Stop memorizing commands and start understanding the architecture. 🛠 The Three Areas You Must Know: Working Directory: Where you actually write the code (Untracked/Modified). Staging Index: The "loading dock" where you prep your changes for a commit. Local Repo (.git/): Your personal history of snapshots. Remote Repo: Where the team collaborates (GitHub/GitLab). 💡 Key Technical Takeaways: Merge vs. Rebase: Merging preserves the full history with a "merge commit." Rebase rewrites history for a clean, linear timeline. Choose wisely based on your team's workflow. File Lifecycle: A file isn't just "saved"—it moves from Untracked → Staged → Committed → Modified. The "Safety Net" Commands: Learn git stash for temporary work and git revert to fix mistakes without destroying the commit history. The Reality Check: You aren’t a Senior Engineer until you can manage a complex branching model without losing data. Save this infographic for your next "merge conflict" headache. #DevOps #Git #VersionControl #CloudEngineering #SoftwareDevelopment #CodingTips #TechCommunity
To view or add a comment, sign in
-
-
Eight years shipping production code, and Git has been the one tool I've touched every single workday. Across banking, healthcare, and manufacturing projects — from Spring Boot microservices on EKS to Kafka pipelines and Terraform modules — Git isn't just version control, it's the safety net that makes modern engineering possible. It's the 30-second rollback when a deploy goes sideways at 11pm, the git blame that answers "why does this exist?" before I break something downstream, the feature branches that let a dozen engineers ship to the same repo without colliding, and the reflog that's rescued me from my own mistakes more times than I'd like to admit. Without it, every microservice repo becomes a shared document with no undo button — multiply that across distributed systems and you don't have a codebase, you have a liability. The real lesson after 8 years? Stop treating Git as a save button. Learn the plumbing — bisect, interactive rebase, reflog — because they pay for themselves the first time production breaks and you're the one holding the pager. #Git #DevOps #SoftwareEngineering #VersionControl
To view or add a comment, sign in
-
-
Wrote a short note on something I recently found useful while working with Git — git cherry-pick. It helped me move specific commits across branches without merging everything, especially in a GitFlow setup. Tried to keep it simple and practical. Read here: https://lnkd.in/dt4xQ7Da #git #devops #versioncontrol
To view or add a comment, sign in
-
🚀 Day 13 of #100DaysOfDevOps Today I explored some powerful Git commands that help in better code management and recovery: 🔹 Config – Set up Git username, email, and preferences 🔹 Ignore – Avoid tracking unnecessary files using .gitignore 🔹 Amend – Modify the last commit (message or changes) 🔹 Reset – Undo changes and move to a previous state 🔹 Reflog – Track all Git actions and recover lost commits 🔹 Cherry-pick – Apply a specific commit from one branch to another 💡 These commands are very useful in real projects for fixing mistakes, managing commits, and maintaining clean history. 📌 Learning step by step, improving every day! #DevOps #Git #VersionControl #LearningJourney #TechSkills #100DaysOfCode
To view or add a comment, sign in
-
-
🔧 Understanding git reset in a simple way (Senior Dev concept) One of the most important Git concepts every developer should clearly understand is how different git reset modes behave. Git has 3 key layers: Commit history (HEAD) Staging area (index) Working directory Here’s the breakdown 👇 🟢 git reset --soft Moves HEAD only Keeps staging area intact Keeps working directory unchanged 👉 Use case: When you want to redo commits but keep changes staged. 🟡 git reset --mixed (default) Moves HEAD Resets staging area Keeps working directory unchanged 👉 Use case: When you want to unstage files but keep your code. 🔴 git reset --hard Moves HEAD Resets staging area Resets working directory ⚠️ This deletes all changes permanently (use carefully) 💡 Simple memory trick: soft → keep everything mixed → unstage changes hard → erase everything Understanding this properly is critical in real-world development and interviews, especially at senior level. #Git #GitHub #SoftwareEngineering #WebDevelopment #DevOps #CodingTips
To view or add a comment, sign in
-
𝗗𝗮𝘆 𝟮𝟰 𝗼𝗳 𝗺𝘆 𝗗𝗲𝘃𝗢𝗽𝘀 𝗝𝗼𝘂𝗿𝗻𝗲𝘆 💻 Isolating development work — created a new Git branch to safely build features without impacting the main code 🌿 𝗧𝗮𝘀𝗸: Git Create Branch 𝗪𝗵𝗮𝘁 𝗜 𝗹𝗲𝗮𝗿𝗻𝗲𝗱 𝘁𝗼𝗱𝗮𝘆: • Importance of branching in Git workflows • Creating branches from the correct base (`master`) • Difference between `git branch` and `git checkout -b` • How Git enforces security using safe.directory • Why isolating features is critical in real projects 𝗪𝗵𝗮𝘁 𝗜 𝗯𝘂𝗶𝗹𝘁 / 𝗽𝗿𝗮𝗰𝘁𝗶𝗰𝗲𝗱: • Navigated to repo `/usr/src/kodekloudrepos/games` • Faced Git error: *dubious ownership* • Fixed it using `git config --global --add safe.directory` • Switched to `master` branch • Created new branch `xfusioncorp_games` • Verified branch creation using `git branch` 𝗖𝗵𝗮𝗹𝗹𝗲𝗻𝗴𝗲𝘀: • Encountered Git security restriction (ownership issue) • Understanding why Git blocks access to certain repos 𝗙𝗶𝘅 / 𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴: • Learned about Git’s security feature for repository ownership • Understood how to safely mark directories as trusted • Realized importance of working on correct branch before creating new ones 𝗞𝗲𝘆 𝗧𝗮𝗸𝗲𝗮𝘄𝗮𝘆: Branching is simple — but doing it correctly and securely is what matters in real-world DevOps. This felt like handling an actual production-level Git issue 🚀 Have you faced Git permission or ownership issues in your projects? How did you handle them? #Day24 #DevOps #Git #VersionControl #Linux #Branching #Automation #CloudComputing #AWS #DevOpsJourney #LearningInPublic #100DaysOfDevOps
To view or add a comment, sign in
-
-
If you are planning to start developing software and get a team of developers collaborate and keep tracking of the changes made by your team and how to merge those changes... You have to learn the basics of git. Watch the video that explain how git work. #git #DevOps https://lnkd.in/gsiJY5gV
How Git Works: Explained in 4 Minutes
https://www.youtube.com/
To view or add a comment, sign in
-
🚀 Git Branching Strategies – The Backbone of Clean & Scalable Development In any DevOps or software development lifecycle, having the right Git branching strategy is crucial for maintaining code quality, enabling collaboration, and ensuring smooth deployments. Here are some of the most important branching strategies every developer should know 👇 🔹 1. Git Flow A structured approach with dedicated branches like main, develop, feature, release, and hotfix. ✔ Best for large teams & release-based projects 🔹 2. Feature Branching Each feature is developed in its own branch and merged back after completion. ✔ Keeps main branch stable ✔ Encourages parallel development 🔹 3. Trunk-Based Development Developers commit frequently to a single branch (main/trunk). ✔ Ideal for CI/CD environments ✔ Faster integrations, fewer merge conflicts 🔹 4. Release Branching Separate branches created for preparing production releases. ✔ Stabilizes code before deployment ✔ Allows ongoing development in parallel 🔹 5. Forking Workflow Common in open-source projects where contributors fork repositories. ✔ Enhances security and collaboration #AWS #CloudDevOPs #Linux #CI/CD #Docker #EKS #Kubernetes #Terraform #Jenkins #Harness #Monitoring Tools #Git #Github #python
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