git stash vs git stash pop Ever been halfway through some changes and suddenly had to switch branches? Here’s a simple breakdown 👇 git stash → Safely stores your unfinished work git stash pop → Restores that work back when you’re ready 🔄 Perfect for quick context switching without losing progress. #DevOps #GitHub
How to use git stash and git stash pop for quick branch switching
More Relevant Posts
-
Let’s understand 3 commonly used Git commands that every developer should know 👇 🔹 git clone → First-time setup It copies a remote repository (like GitHub) to your local system. 🖥️ Example: git clone https://lnkd.in/ggRei-DU 📦 Think of it as downloading the whole project with its history. 🔹 git fetch → Check for updates It brings the latest changes from the remote repo but doesn’t update your code yet. 👀 You can see what changed before merging. 🔹 git pull → Get & apply updates It’s like fetch + merge — it downloads changes and updates your local branch immediately. 💡 In short: clone → Get repo fetch → See updates pull → Get updates #Git #GitHub #DevOps #CodingLife #SoftwareDevelopment #LearnGit #VersionControl #Developers
To view or add a comment, sign in
-
-
Git Internals: How Your Code Travels from Local to the Cloud We all use git add, git commit, and git push daily — but few truly understand what happens behind the scenes. Git isn’t just a source control tool; it’s a distributed file system for code, built on snapshots, hashing (SHA-1), and graph-based history tracking. Here’s the flow every developer should know 👇 🔹 Working Directory – Where you write and modify files. 🔹 Staging Area (Index) – A snapshot of what you plan to commit next. 🔹 Local Repository (.git folder) – Stores commits, branches, and tags as immutable objects. 🔹 Remote Repository (GitHub/GitLab/Bitbucket) – Syncs your local changes with the rest of the team. When you commit, Git doesn’t copy entire files — it stores compressed snapshots and links them via directed acyclic graphs (DAGs), making operations lightning fast. Over to you — what’s your favorite Git command when things go south? Mine: git reflog — the hidden time machine #Git #VersionControl #DevOps #GitHub #FullStackDeveloper #Java #SoftwareEngineering #SystemDesign #TechLeadership
To view or add a comment, sign in
-
-
Lock yourself in a room and master this Git command (you'll thank me later): 1. `git push --force-with-lease` This command contains the biggest secret to safe Git pushing. Lessons: • Prevent accidental overwrites • Ensure your local branch is up-to-date before pushing We’ve all been there—accidentally using `git push --force`, overwriting someone else's work, and causing chaos. But did you know there’s a safer alternative? Instead of: ```sh git push --force ``` Use: ```sh git push --force-with-lease ``` Why? `--force-with-lease` ensures that your local branch is up-to-date before force-pushing. It prevents accidental overwrites if someone else has pushed changes while you were working. How It Works: - If no one else has pushed new commits, your force-push succeeds. - If someone else has pushed, Git stops you from overwriting their work. This small change prevents mistakes and keeps your team’s workflow smooth. Who else has used this in their workflow? Share your experience below. #GitTips #GitLab #GitHub #SoftwareEngineering #DevOps #FullStackDevelopment
To view or add a comment, sign in
-
Automating My Frontend App Deployment Using Jenkins, Docker & GitHub Webhooks Over the past few days, I’ve been deep-diving into CI/CD pipelines—and today, I finally achieved a fully automated Docker image build and deployment using Jenkins integrated with GitHub Webhooks! Here’s what I accomplished. 🔹 Configured Jenkins Pipeline (Declarative) to build, tag, push, and deploy Docker images automatically. 🔹 Integrated Docker Hub using secure Jenkins credentials for seamless image uploads. 🔹 Implemented GitHub Webhooks so every new code push triggers an automatic build & container deployment. 🔹 Deployed the containerized app on my custom port using Docker—with clean stages like Build, Push, Stop Old Container, Run New Container, and Verify Deployment. 🔹 Debugged several syntax and credential issues—learned the importance of correct withCredentials usage and environment variable handling in Groovy. 💡 Key Takeaway: Understanding the automation flow between GitHub → Jenkins → Docker Hub → Server gives a real sense of DevOps power. Seeing your container spin up instantly after a commit is pure satisfaction! #Jenkins #DevOps #Docker #CICD #GitHub #Automation #LearningJourney #AniketGaud #SoftwareEngineering #TechJourney
To view or add a comment, sign in
-
-
Just ran into a neat workflow solution for Docker builds in Git repos. Have you ever wanted to build an image from your code but only include committed changes? Stashing changes works, but there's a cleaner way. Git worktrees are brilliant for this. You can create a separate worktree from your committed code while keeping your current branch untouched. No need to stash, commit, or revert - just build directly from the committed version. This has saved me from more than one "oops, didn't mean to include those debug prints" moment in CI/CD pipelines. What's cool is how it solves a subtle but important problem: the mental load of managing temporary changes. As a full-stack developer, anything that reduces context switching helps me stay in the flow. It's these small workflow tweaks that add up to significant productivity gains over time. If you're building Docker images from Git repos, definitely give this approach a try. Clean builds, less mental overhead, and fewer surprises in production. #Docker #Git #DevOps #Productivity #FullStack
To view or add a comment, sign in
-
💻 Facing Merge Conflicts & Lost Code in Git? Here’s What Helped Me. Today I ran into one of the most frustrating moments as a developer — merge conflicts and the sudden feeling that some of my code had “disappeared” after a pull. Instead of panicking, I took a step back and revisited two powerful Git commands that saved the day: 🔄 git pull --rebase A cleaner alternative to the usual merge, it helped me apply my local commits on top of the latest remote changes. This reduced unnecessary merge commits and made the history easier to follow. ⏪ git rebase --abort When the rebase got messy (it happens!), this command allowed me to safely roll back to the state before the rebase started — no damage done. 🧠 Key takeaway: Git can feel intimidating when conflicts pop up, but understanding how to use rebase effectively can turn chaos into clarity. It keeps your commit history tidy and gives you fine-grained control when integrating changes. If you're just getting comfortable with Git, don’t be afraid of these commands—mastering them will make you more confident and efficient as a developer. #git #github #softwaredevelopment #devlife #versioncontrol #learningeveryday
To view or add a comment, sign in
-
What do GitHub Actions workflows look like in prod? I'll give you a clue: Branching strategies. One of the benefits of CI/CD is that any code that passes all stages of the development pipeline is automatically pushed to production. To really leverage that benefit however, we implement branching strategies. This is a way of filtering our workflow triggers, only running our them when changes are pushed to specific branches. In this case, it would be the main branch (or whatever branch our production code is on). This allows us to work on new features & bug fixes on separate branches in the background, keeping our application running until our changes are ready, maximising uptime. Have you implemented branching strategies into your work? #devops #git #github #cicd
To view or add a comment, sign in
-
-
From "git init" to "git commit", "git merge", and beyond, this 6-minute read breaks down Git fundamentals with clarity. https://lnkd.in/eyPAYFhR #Git #DevOps #VersionControl #GitCommands #TechDocs #GitHub
To view or add a comment, sign in
-
-
Ever struggled to manage shared code across multiple Git repositories? Just published a guide on Git submodules: what they are, real-world workflows, and why they can be a lifesaver (or a headache) depending on your approach. Whether you’re pinning dependencies or wrestling with CI/CD, this guide gives you practical tips to make submodules work for you. Check it out—would love to hear about your own submodule experiences! #git #devops #softwaredevelopment #medium
To view or add a comment, sign in
-
In real-time projects, Git is our best friend — but sometimes it becomes a puzzle! Here are some common Git issues teams face in day-to-day DevOps work 👇 🚫 Merge Conflicts — when multiple people change the same file or line. 💥 Detached HEAD State — happens when you checkout a commit instead of a branch. 🔁 Rebase gone wrong — leads to overwritten commits or lost changes. 🕵️ Wrong branch commits — pushing code to main instead of your feature branch. 🔒 Permission errors — while pushing or pulling due to access or SSH key issues. ✅ Tip: Always take a backup branch before doing a rebase or reset, and pull the latest changes before committing. Git is powerful — mastering it saves hours in debugging and helps maintain clean version control in any DevOps pipeline. #Git #GitHub #DevOps #VersionControl #CICD
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