1. Git stash command list
Git stash with auto random name given by git:
git stash
Git stash with name - keep file without commiting code and push locally.
git stash -m "old code"
Check changes list in stash
git stash list
Apply stash changes: git stash apply
:- its apply the latest stash changes.
Apply specefic changes according to stash list
git stash apply stash@{0}
Delete latest stash: it delete the latest (last) form stash list.
git stash pop
Delete particular stash: it delete the particular stash from list
git stash drop stash@{1}
Delete all stash
git stash clear
Create new stash branch with existing stash list. Its also delete the stash@{0}.
git stash branch "branch_name" stash@{0}
- Check remote url: to see the current remote URL.
git remote -v
How to know the git username and email saved
To know the username, type:
git config user.name
To know the email, type:
git config user.email
Configuring Git username and email.
git config --global user.name "My Name"
git config --global user.email "myemail@example.com"
Top comments (0)