Git for Noob-to-Pro — #5(Stash)

Search for a command to run...

No comments yet. Be the first to comment.
Bun, the hyper-fast JavaScript runtime known for its incredible speed and Zig-based architecture, is being completely rewritten in Rust. For a project that has over 22 million monthly downloads and ea

Next.js 16.3 is almost here, and it's packed with a ton of improvements and let's see them in this post 1.Instant Navigation For a while now, there’s been a valid, lingering debateServer Components vs

It’s official. React has merged its long-awaited Rust port of the React Compiler (formerly known as React Forget) into the main repository. What started as an experimental research project by Joseph S

If you follow modern technology trends, you have likely been led to believe that artificial intelligence is entirely built on Python. Every tutorial, machine learning framework documentation, and open

Just when the JavaScript ecosystem was catching its breath after last week’s TanStack Router compromise, the Mini Shai-Hulud supply chain worm has continued its relentless march. Developed by the thre

If you don’t have time to read but want to know what’s there in this series. Find the quick read 👇

We are going to see the commonly used Git snippets for the repository which will make you from Noob to Pro.
The Git Repository snippets that we are going to look at in this series are
Local Repository
Branches
Commits
Module
Stash
In this post, we are going to see the topic Stash which has the following sub-topics like
Create a Stash
List all stashes
Apply a Stash
Apply the latest Stash
Delete a Stash
Delete all Stashes

Saves the current state of the working directory and indexes into a new stash.
Use git stash save to save the current state of the working directory and index it into a new stash.
You can optionally use the -u option to include untracked files.
You can optionally provide a <message> for the stash.
git stash save [-u] []
# Example
git stash save
# Creates a new stash
git stash save -u
# Creates a new stash, including untracked files
git stash save "Bugfix WIP"
# Creates a new stash with the message "Bugfix WIP"
Displays a list of all stashes.
git stash list to view a list of all stashes.git stash list
# Example
git stash list
# stash@{0}: WIP on patch-1: ee52eda Fix layout bug
Applies a specific stash.
git stash apply <stash> to apply the given <stash>.git stash apply
# Example
git stash apply stash@{1} # Applies `stash@{1}`
Applies the latest stash.
git stash apply to apply the latest stash.git stash apply
# Example
git stash apply # Applies the latest stash
Deletes a specific stash.
git stash drop <stash> to delete the given <stash>.git stash drop
# Example
git stash drop stash@{1} # Deletes `stash@{1}`
Deletes all stashes.
git stash clear to delete all stashes.git stash clear
# Example
git stash clear
# Deletes all stashes

And that’s the end of Git for Noob-to-Pro series 😃