In Git, stash
is a commonly used command to temporarily save changes to the current working directory so that you can switch branches or apply other changes without losing current modifications. The following is a detailed explanation of the stash
command:
-
git stash save "message"
:- This command saves the changes to the current working directory to a new stash.
-
"message"
The parameter is optional and is used to provide a short descriptive message to explain the contents of the stash.
-
git stash list
:- This command lists all stash saved in the current warehouse.
- Each stash has an identifier and corresponding description message.
-
git stash apply stash@{n}
:- This command applies the specified stash and applies the saved changes to the current branch.
-
stash@{n}
The parameter indicates the identifier of the stash to be applied, where
n
is the index number of stash.
-
git stash pop
:- This command applies the latest stash and applies the saved changes to the current branch.
- At the same time, it will also remove the applied stash from the stash list.
-
git stash branch <branch_name></branch_name>
:- This command will create a new branch and apply the specified stash to the new branch.
-
<branch_name></branch_name>
The parameter is the name of the new branch.
-
git stash drop stash@{n}
:- This command discards the specified stash and deletes it from the stash list.
-
stash@{n}
The parameter indicates the identifier of the stash to be discarded.
-
git stash clear
:- This command will delete all saved stash and clear the stash list.
Использование команды stash
может быть очень полезно при обработке нескольких переключателей ветвей или сохранении временных изменений. Вы можете использовать команду stash
, чтобы сохранить изменения в текущем рабочем каталоге, переключиться на другие ветки или применить другие изменения, а затем вернуться и применить ранее сохраненный тайник. Это гарантирует, что ваш рабочий каталог всегда будет чистым и никакие важные изменения не будут потеряны.
The above is the detailed content of Detailed explanation of the common git command stash.. For more information, please follow other related articles on the PHP Chinese website!

Data recovery is always a heated topic. To successfully restore data from your device, you should know how it stores data. You can learn the difference between RAID recovery and hard drive recovery from this php.cn post.

Do you run into Word text disappearing while typing? Some letters or even paragraphs might disappear from your document. What’s wrong with it? In this post from php.cn Website, we will take a closer look at the Word automatically deleting text issue

When you are trying to log into Overwatch 2, you may receive the LC-208 error message and it prevents your game from connecting to the game servers. This post from php.cn introduces how to fix the LC-208 Overwatch error.

Generally, you can quickly access and edit Google Drive files from File Explorer. However, sometimes you may encounter the issue of “Google Drive disappeared from File Explorer”. Here this post on php.cn tells you how to get Google Drive to show up i

Why is my computer on the welcome screen for so long? How to fix Windows 7 welcome screen slow? If you still run Windows 7 on your PC and meet this issue, you are in the right place and multiple solutions will be given here by php.cn.

Want to use the built-in password management tool – Credential Manager to manage your login credentials for web and apps? How can you open Credential Manager in Windows 11? In this post, php.cn collected multiple ways to access this utility, and let’

Microsft Defender Antivirus has a feature called Periodic scanning, which can be enabled when you have installed another antivirus product on a Windows 11/10 device. Now, this post from php.cn teaches you how to enable/disable Periodic scanning on Wi

Have you ever encountered the issue of “Excel hyperlinks not working”? Do you know how to deal with it? In this post from php.cn, you can get several feasible solutions to get rid of this problem. And you will know a professional data recovery tool t


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver CS6
Visual web development tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft