Git Stash is a distributed Version control tool. Git that locally stores all the most recent changes in a workspace. it’s means git stash to store safely in a hidden place (the stash stack).
Step : How to git stash Apply
Step 1: Git stash
Use ” Cat ” command to create new git code file and write something on that file “Ex: This is my code which I will store in stash” and “Ctrl+D” to save.
# cat >workfile
# git status
# git add .
# git commit -m “stash commit”
# git log –oneline
Open same file “workfile” add something new cord
# vi workfile
Use ” git stash ” command to save working code into stash
Note: stash will save before “add and commite“
# cat workfile
# git stash
Step 2 : git stash list
Use “git stash list” command to check stash storage
# git stash list
add something on that file
# vi workfile
Now that are showing my second stash ” stash@ {1}“
# git stash
# git stash list
# cat workfile
Step 3: git stash apply
# git stash apply stash@{0}
# cat workingfile
Now, you can “add and commit” restore stash data
# git add.
# git commit -m “stash file commit”
Restore, another stash data
# git stash apply stash@{1}
# vi workingfile
change and arrange restore stash data
# git add.
# git commit -m “conflit file commit”
Check final commit data
# git status
# git log –oneline
Step 4: git stash clear
If, you want to clean all stash date after restore use “git stash clear”
# git stash list
# git stash clear
# git stash list
Install Git in Linux | Git log, Push, Pull
- Install Git
- Set up Git
- Create working file
- Check git log
- Create GitHub Account
- Generate and copy 2FA password
- Push and Pull working data to Github account for use world wide.
How to git branch Create, Delete, Rename
- create a code and commit
- Create new branch
- Code add and commit in new branch
- Rename branch
- Delete branch
Git Merge branch and Conflict – Step By Step
- Create branch
- Git Merge branch create
- Conflict branch
I simply could not depart your website prior to suggesting that I extremely enjoyed the standard information an individual supply on your visitors? Is going to be back steadily to investigate cross-check new posts.
It’s hard to find knowledgeable people on this topic, but you sound like you know what you’re talking about! Thanks