Skip to content

Commit d208656

Browse files
ᛘ day 29 - branch stash
1 parent 96735a0 commit d208656

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Diff for: Day 29/README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Day 29
2+
3+
Today we will learn to keep the changes in stash within another branch.
4+
5+
## Problem Statement:
6+
7+
If you want to keep your changes but they don't belong to the main branch, you can easily
8+
create a new branch from your stashed changes. Just use: <br>
9+
`git stash branch ‹branchname> ‹stash>`
10+
11+
If you just want to use the latest stash entry, you can leave the «stash> option empty. <br>
12+
Create a new branch from the stashed changes!
13+
14+
### Files:
15+
- recipe
16+
17+
18+
### Question:
19+
- Did you create a new branch from the stashed changes?
20+
21+
<div align="center">
22+
<img src="https://github.com/ArnabKumarRoy02/Learn-git/assets/86621483/ac4c253e-5792-4474-9f4d-2c6c1065fe26" width=450>
23+
<p>Description of the problem.</p>
24+
</div>
25+
26+
## Solution:
27+
28+
1. Checkout the stash list to check which stash to remove.
29+
```bash
30+
git stash list
31+
```
32+
33+
2. Create a new branch in particular stash.
34+
```bash
35+
git stash branch new stash@{0}
36+
```
37+
38+
<div align="center">
39+
<img src="https://github.com/ArnabKumarRoy02/Learn-git/assets/86621483/303244a3-a7ba-4088-811e-3b4b8b6c3a43" width=450>
40+
<p>Description of the solution.</p>
41+
</div>

0 commit comments

Comments
 (0)