Member-only story
Advanced Git Concepts You Should Know
Have you gotten accustomed to the basics of git
, but the advanced concepts make you scratch your head?
This article got you covered, not only will it introduce you to the advanced git
concepts, but also show you how to use them in a real-world scenario! Let's dive in.
Stash
Let’s first check the definition:
Git stash is a built-in command with the distributed version control tool in Git that locally stores all the most recent changes in a workspace and resets the state of the workspace to the prior commit state.
The stash can be thought of as a temporary storage for the changes you made, but did not commit.
The real-world use case for this feature would be when you are not done working on the changes, but need to pull the updates from the remote repository.
To use stash, you need to add the files to the staging area
git add .
and push it to the stash
git stash pushORgit stash push -m "<stash message>"