@@ -22,7 +22,7 @@ git init
22
22
23
23
## Commands
24
24
25
- ⚡️ ** The repetitive commands that I (and everyone else) use regularly.**
25
+ ⚡️ The ** repetitive** commands that I (and everyone else) use regularly.
26
26
27
27
``` sh
28
28
@@ -43,14 +43,14 @@ git push -u origin master
43
43
44
44
```
45
45
46
- 🎩 ** Clone a repository in your computer.**
46
+ 🎩 ** Clone** a repository in your computer.
47
47
48
48
``` sh
49
49
# clone a repo
50
50
git clone [repo_url]
51
51
```
52
52
53
- 🌲 ** The git commands you need to know to work with branches. **
53
+ 🌲 The git commands you need to know to * work* with ** branches** .
54
54
55
55
``` sh
56
56
@@ -63,20 +63,62 @@ git branch [branch_name]
63
63
# checkout to the new branch
64
64
git checkout [branch_name]
65
65
66
- # OR
66
+ # OR
67
67
68
68
# create AND checkout to the new branch
69
69
git checkout -b [branch_name]
70
70
71
71
# pushing the new branch on GitHub
72
72
git push origin [branch_name]
73
73
74
- # delete a branch
74
+ # delete a branch locally
75
75
git branch -d [branch_name]
76
76
77
+ # delete a branch on GitHub
78
+ git push origin -d [branch_name]
79
+
80
+ # pulling changes from some other branch
81
+ git pull origin [branch_name]
82
+
83
+ # merge a branch with the current active branch
84
+ git merge [branch_name]
85
+
86
+ # merge a branch to some defined branch
87
+ git merge [source_branch] [target_branch]
88
+
77
89
```
78
90
79
- 🎯 ** Keep your GitHub forked repo in sync with the original repository.**
91
+ 📚 ** Stashing** your untracked changes — Stash saves all the * new untracked changes* and rewind your repo to the last commit.
92
+
93
+ ``` sh
94
+
95
+ # stash the untracked changes
96
+ git stash
97
+
98
+ # pop an existing stack
99
+ git stash apply stash@{stash_number}
100
+
101
+ # list all stashes
102
+ git stash list
103
+
104
+ # delete all saved stashes
105
+ git stash clear
106
+
107
+ ```
108
+
109
+ 🍒 ** Pulling** all the new changes from the remote repository on GitHub
110
+
111
+ ``` sh
112
+
113
+ # pull changes from master branch
114
+ git pull origin master
115
+
116
+ # pulling changes from some other branch
117
+ git pull origin [branch_name]
118
+
119
+ ```
120
+
121
+ 🎯 Keep your GitHub forked repo in ** sync** with the original repository.
80
122
81
123
``` sh
82
124
@@ -145,7 +187,9 @@ function gacp() {
145
187
146
188
```
147
189
148
- 💥 ** Fetching changes from the original repo to your forked repo.**
190
+ ### 🚀 Usage
191
+
192
+ Fetching changes from the original repo to your forked repo.
149
193
150
194
``` sh
151
195
@@ -162,7 +206,7 @@ fetchremotemn
162
206
163
207
```
164
208
165
- 🎲 ** Usage of the rest of the workflows.**
209
+ Usage of the rest of the workflows.
166
210
167
211
``` sh
168
212
0 commit comments