๐†๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐‚๐จ๐ฆ๐ฆ๐š๐ง๐๐ฌ

Meghasharmaa
2 min readJan 14, 2024

--

โ€ข ๐’๐ญ๐š๐ฌ๐ก ๐‚๐ก๐š๐ง๐ ๐ž๐ฌ
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก` Stashes both staged and unstaged changes.

โ€ข ๐’๐ญ๐š๐ฌ๐ก ๐ฐ๐ข๐ญ๐ก ๐š ๐Œ๐ž๐ฌ๐ฌ๐š๐ ๐ž
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐ฌ๐š๐ฏ๐ž โ€œ๐˜๐จ๐ฎ๐ซ ๐ฌ๐ญ๐š๐ฌ๐ก ๐ฆ๐ž๐ฌ๐ฌ๐š๐ ๐žโ€` Stashes changes with a descriptive message.

โ€ข ๐’๐ญ๐š๐ฌ๐ก ๐”๐ง๐ญ๐ซ๐š๐œ๐ค๐ž๐ ๐…๐ข๐ฅ๐ž๐ฌ
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก -๐ฎ ๐จ๐ซ ๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก โ€” ๐ข๐ง๐œ๐ฅ๐ฎ๐๐ž-๐ฎ๐ง๐ญ๐ซ๐š๐œ๐ค๐ž๐` Stashes untracked files along with changes.

โ€ข ๐‹๐ข๐ฌ๐ญ ๐’๐ญ๐š๐ฌ๐ก๐ž๐ฌ
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐ฅ๐ข๐ฌ๐ญ` Lists all stashes youโ€™ve created.

โ€ข ๐€๐ฉ๐ฉ๐ฅ๐ฒ ๐‹๐š๐ญ๐ž๐ฌ๐ญ ๐’๐ญ๐š๐ฌ๐ก
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐š๐ฉ๐ฉ๐ฅ๐ฒ` Applies the latest stash to the working directory. The stash is not removed.

โ€ข ๐€๐ฉ๐ฉ๐ฅ๐ฒ ๐š ๐’๐ฉ๐ž๐œ๐ข๐Ÿ๐ข๐œ ๐’๐ญ๐š๐ฌ๐ก
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐š๐ฉ๐ฉ๐ฅ๐ฒ ๐ฌ๐ญ๐š๐ฌ๐ก@{๐ง}` Applies the stash with index `๐ง`.

โ€ข ๐๐จ๐ฉ ๐‹๐š๐ญ๐ž๐ฌ๐ญ ๐’๐ญ๐š๐ฌ๐ก (๐€๐ฉ๐ฉ๐ฅ๐ฒ ๐š๐ง๐ ๐ƒ๐ซ๐จ๐ฉ)
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐ฉ๐จ๐ฉ` Applies the latest stash and removes it from the stash list.

โ€ข ๐ƒ๐ซ๐จ๐ฉ ๐š ๐’๐ญ๐š๐ฌ๐ก
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐๐ซ๐จ๐ฉ` Removes the latest stash without applying it.

โ€ข ๐ƒ๐ซ๐จ๐ฉ ๐š ๐’๐ฉ๐ž๐œ๐ข๐Ÿ๐ข๐œ ๐’๐ญ๐š๐ฌ๐ก
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐๐ซ๐จ๐ฉ ๐ฌ๐ญ๐š๐ฌ๐ก@{๐ง}` Removes the stash with index `๐ง`.

โ€ข ๐‚๐ฅ๐ž๐š๐ซ ๐€๐ฅ๐ฅ ๐’๐ญ๐š๐ฌ๐ก๐ž๐ฌ
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐œ๐ฅ๐ž๐š๐ซ` Removes all stashes.

โ€ข ๐‚๐ซ๐ž๐š๐ญ๐ž ๐š ๐๐ž๐ฐ ๐๐ซ๐š๐ง๐œ๐ก ๐š๐ง๐ ๐€๐ฉ๐ฉ๐ฅ๐ฒ ๐’๐ญ๐š๐ฌ๐ก
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐›๐ซ๐š๐ง๐œ๐ก <๐ง๐ž๐ฐ_๐›๐ซ๐š๐ง๐œ๐ก_๐ง๐š๐ฆ๐ž>` Creates a new branch and applies the latest stash to it.

โ€ข ๐’๐ก๐จ๐ฐ ๐‚๐ก๐š๐ง๐ ๐ž๐ฌ ๐ข๐ง ๐š ๐’๐ญ๐š๐ฌ๐ก
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐ฌ๐ก๐จ๐ฐ -๐ฉ ๐ฌ๐ญ๐š๐ฌ๐ก@{๐ง}` Shows the changes in a specific stash.

โ€ข ๐€๐ฉ๐ฉ๐ฅ๐ฒ ๐’๐ญ๐š๐ฌ๐ก ๐ฐ๐ข๐ญ๐ก ๐€๐ฎ๐ญ๐จ-๐Œ๐ž๐ซ๐ ๐ž
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐š๐ฉ๐ฉ๐ฅ๐ฒ โ€” 3๐ฐ๐š๐ฒ ๐ฌ๐ญ๐š๐ฌ๐ก@{๐ง}` Attempts to apply the stash using a 3-way merge.

โ€ข ๐’๐ญ๐š๐ฌ๐ก ๐Ž๐ง๐ฅ๐ฒ ๐”๐ง๐ญ๐ซ๐š๐œ๐ค๐ž๐ ๐…๐ข๐ฅ๐ž๐ฌ
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐ฌ๐š๐ฏ๐ž โ€” ๐ข๐ง๐œ๐ฅ๐ฎ๐๐ž-๐ฎ๐ง๐ญ๐ซ๐š๐œ๐ค๐ž๐` Stashes only untracked files.

โ€ข ๐’๐ญ๐š๐ฌ๐ก ๐Š๐ž๐ž๐ฉ๐ข๐ง๐  ๐ˆ๐ง๐๐ž๐ฑ ๐‚๐ก๐š๐ง๐ ๐ž๐ฌ
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐ฌ๐š๐ฏ๐ž โ€” ๐ค๐ž๐ž๐ฉ-๐ข๐ง๐๐ž๐ฑ` Stashes changes but keeps changes in the index.

โ€ข ๐’๐ญ๐š๐ฌ๐ก ๐‚๐ก๐š๐ง๐ ๐ž๐ฌ ๐ข๐ง๐ญ๐ž๐ซ๐š๐œ๐ญ๐ข๐ฏ๐ž๐ฅ๐ฒ
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐ฌ๐š๐ฏ๐ž -๐ฉ` Allows you to interactively choose which changes to stash.

โ€ข ๐€๐ฉ๐ฉ๐ฅ๐ฒ ๐’๐ญ๐š๐ฌ๐ก ๐š๐ฌ ๐š ๐Œ๐ž๐ซ๐ ๐ž
`๐ ๐ข๐ญ ๐ฌ๐ญ๐š๐ฌ๐ก ๐š๐ฉ๐ฉ๐ฅ๐ฒ -๐ฆ <๐ฆ๐ž๐ซ๐ ๐ž_๐ฉ๐š๐ซ๐ž๐ง๐ญ_๐ง๐ฎ๐ฆ๐›๐ž๐ซ>` Applies the stash as a merge. Useful when the stash represents changes from a different branch.

--

--

Meghasharmaa
Meghasharmaa

Written by Meghasharmaa

DevOps Architect | AWS | Docker | Kubernetes | Terraform | Google Cloud | Python

No responses yet