Git stash: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Git Commands =Overview= Stash the changes in a dirty working directory away. The command saves the local modificati...")
 
No edit summary
Line 5: Line 5:


Stash the changes in a dirty working directory away. The command saves the local modifications away and reverts the working directory to match the HEAD commit.
Stash the changes in a dirty working directory away. The command saves the local modifications away and reverts the working directory to match the HEAD commit.
To stash away changes:
git stash
Saved working directory and index state WIP on ''branch-name'': 0d0178916ee ''commit comment''


The modifications stashed away can be listed with:
The modifications stashed away can be listed with:

Revision as of 23:53, 22 August 2019

Internal

Overview

Stash the changes in a dirty working directory away. The command saves the local modifications away and reverts the working directory to match the HEAD commit.

To stash away changes:

git stash
Saved working directory and index state WIP on branch-name: 0d0178916ee commit comment 

The modifications stashed away can be listed with:

git stash list
git stash show

They can be restored, potentially in top of a different commit, with:

git stash apply