Skip to content

Commit 90c829a

Browse files
authored
Update README.md
1 parent 19eb1a7 commit 90c829a

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,26 @@
5959

6060
14 - 16 can also be done via GitHub via Pull request to review changes before the merge
6161

62+
<b><ins>How to Abort the rebase and restore the branch to its original state.</ins></b> <br>
63+
```git rebase --abort``` <br>
64+
65+
66+
## Stash
67+
68+
<b>Stash:</b> Temporarily save your changes without committing them to a branch<br>
69+
70+
<b>Commands: </b><br>
71+
- ```git stash``` -> save changes without committing them to a branch <br>
72+
- ```git stash save "Your stash message here"``` -> save changes with a message<br>
73+
- ```git stash list``` -> list all stashes <br>
74+
- ```git stash apply``` -> Reapply the most recent stash <br>
75+
- ```git stash apply stash@{n}```-> Reapply a specific stash from list <br>
76+
- ```git stash drop``` -> Remove latest stash<br>
77+
- ```git stash drop stash@{n}``` -> Remove specific stash from list<br>
78+
- ```git stash clear``` -> clear all stashes<br>
79+
- ```git stash branch <branch-name>``` -> Create a new branch from a stash<br>
80+
81+
6282
<b><ins>You have uncommitted changes in a local branch and want to switch to another branch without passing over those changes</ins></b> <br>
6383
Step 1: You are on `branch-A` with uncommitted changes<br>
6484
```git stash``` # Save changes and clean the working directory<br>
@@ -69,8 +89,6 @@ Step 2: Work on `branch-B` and then return to `branch-A` <br>
6989
```git stash apply``` # Restore the stashed changes on `branch-A`<br>
7090

7191

72-
<b><ins>How to Abort the rebase and restore the branch to its original state.</ins></b> <br>
73-
```git rebase --abort``` <br>
7492

7593
<b>Fetch the branch branch_name from the remote (origin) and creates a corresponding local branch with the same name.</b> <br>
7694
```git fetch origin branch_name:branch_name```<br><br>
@@ -94,8 +112,9 @@ After performing <b>git pull</b> you get this error:
94112
the upstream branch of your current branch does not match the name of your current branch
95113
```
96114

97-
<b>Solution:</b> <br>
115+
<b>Explaination:</b> <br>
98116
Your local and remote branch have different names<br><br>
117+
99118
<b>2 possible solutions</b><br>
100119
1.) rename your <b>local branch</b> to same name as <b>remote branch</b><br/>
101120
2.) delete the <b>remote branch</b> and push again

0 commit comments

Comments
 (0)