Star

Created With

linkStashing your git changes

One of the powerful features of git, is the ability to stash your changes

The great benefit of stashing, is that it allows you to multitask effectively!

For example, you are working on this great new feature, all of a sudden there is a crisis! The API your customers used suddenly stops working. You are required to go and fix it up immediately. What do we do with the work we have made on our new feature? We stash it!

linkSo let's do it!

1link$# Check your current changes

2link$git status

3link$# Stash them

4link$git stash

5link$# Checkout of your feature branch

6link$git checkout <otherbranch>

7link$# ....fix the bug on the other branch once

8link$# When done we check back into our <featurebranch>

9link$git checkout <featurebranch>

10link$# Reapply the changes from earlier using pop

11link$git stash pop

12link$# Check the changes were reapplied

13link$# git status

linkWith SVN this type of workflow was difficult. It caused developers to commit unfinished work to the master repo. Not good!

There is a whole bunch more you can do with git stash check out this Atlassian guide to learn more!

Stashing your git changesSo let's do it!With SVN this type of workflow was difficult. It caused developers to commit unfinished work to the master repo. Not good!
Content

Home Backstory Why Git? Setting Up GitHub GitHub CLI Your GitHub Profile GitHub Pages Creating A New Repo Cloning A Repository Your First Commit Ignoring Files In Git Stashing Your Changes Branching With Git Merging Git Branches Rebasing Vs Merging Git Workflows Fork And Pull Flow Your First Pull Request Automated Security Alerts Seeing The Differences Removing/Deleting Files Reverting Your Commits Configuring your Git Commit Templates Creating Shortcuts Dotfile Management Sponsoring Open Source Handy Commands Thank You



Developer Student Clubs

logo2.png