-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.html
More file actions
384 lines (324 loc) · 16.3 KB
/
commands.html
File metadata and controls
384 lines (324 loc) · 16.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<!doctype html>
<html>
<head>
<title> Git Commands - Commands</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link rel = "stylesheet" href = "design.css">
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
</head>
<body class = "text-center" id = "bg-gradient">
<header class = "masthead mb-auto">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="index.html">Git Commands</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link " href="index.html">Homepage <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="installation.html">Installation</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="commands.html">Commands</a>
</li>
<li class="nav-item">
<a class="nav-link" href="help.html">Help</a>
</li>
</ul>
<img id = "optional" class = "imagesize" src = "http://getdrawings.com/vectors/github-icon-vector-31.png">
</div>
</nav>
</header>
<main>
<br><br><br>
<div class="container">
<h1 class="display-4">Commands section</h1>
<p class="lead">Below are some essential commands of git.</p>
</div>
<div class = "container">
<table class="table table-bordered">
<thead class="thead-dark">
<tr>
<th scope="col">Starting Project</th>
<th scope="col">Inspection & Comparison</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="row">
<div class="col-md-6 themed-grid-col">git init</div>
<div class="col-6 themed-grid-col">Initialize new local repository</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git log</div>
<div class="col-6 themed-grid-col">View changes</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git clone "link"</div>
<div class="col-6 themed-grid-col">Creates local copy of remote repository</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git log --summary</div>
<div class="col-6 themed-grid-col">Detailed log</div>
</div>
</td>
</tr>
<tr>
<td></td>
<td> <div class="row mb-3">
<div class="col-md-6 themed-grid-col">git log --oneline</div>
<div class="col-6 themed-grid-col">Brief log</div>
</div></td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-md-6 themed-grid-col"></div>
<div class="col-6 themed-grid-col"></div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git diff [source branch] [target branch]</div>
<div class="col-6 themed-grid-col">Preview changes before merging</div>
</div>
</td>
</tr>
</tbody>
<thead class="thead-dark">
<tr>
<th scope="col">Basic Snapshots</th>
<th scope="col">Branching and merging</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<div class="row">
<div class="col-md-6 themed-grid-col">git status</div>
<div class="col-6 themed-grid-col">Checks Status</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git branch</div>
<div class="col-6 themed-grid-col">Lists all branches</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git add "filename.txt"</div>
<div class="col-6 themed-grid-col">Add file for preparation</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git branch --a</div>
<div class="col-6 themed-grid-col">List all branches local and remote</div>
</div>
</td>
</tr>
<tr>
<td>
<div class = "row mb-3">
<div class="col-md-6 themed-grid-col">git add -A </div>
<div class="col-6 themed-grid-col">Adds all new and edited file for preparation</div>
</div>
</td>
<td> <div class="row mb-3">
<div class="col-md-6 themed-grid-col">git branch [branch name] </div>
<div class="col-6 themed-grid-col">Creates new branch</div>
</div></td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-md-6 themed-grid-col">git commit -m "message"</div>
<div class="col-6 themed-grid-col">Commit changes</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git branch -d [branch name]</div>
<div class="col-6 themed-grid-col">Deletes branch</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-md-6 themed-grid-col">git rm -r [file-name.txt]"</div>
<div class="col-6 ">Removes file or folder</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 ">git push origin --delete [branch name]</div>
<div class="col-6 ">Deletes remote branch</div>
</div>
</td>
</tr>
<thead class="thead-dark">
<tr>
<th scope="col">Sharing & Updating Projects</th>
<th style= "background-color:transparent;font-weight:400;color:black; border-bottom: transparent;" scope="col">
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git checkout -b [branch name]</div>
<div class="col-6 themed-grid-col">Create new branch and switch to it</div>
</div>
</th>
</tr>
</thead>
<tr>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git push origin [branch name]</div>
<div class="col-6 themed-grid-col">Push a branch to remote repository</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git checkout -b [branch name] origin/[branch name]</div>
<div class="col-6 themed-grid-col">Clone remote branch and switch to it</div>
</div>
</td>
</tr>
<tr>
<td>
<div class = "row mb-3">
<div class="col-md-6 themed-grid-col">git push -u origin [branch name] </div>
<div class="col-6 themed-grid-col">Push change to remote repository and remember branch</div>
</div>
</td>
<td> <div class="row mb-3">
<div class="col-md-6 themed-grid-col">git branch -m [old branch name] [new branch name] </div>
<div class="col-6 themed-grid-col">Rename a local branch</div>
</div></td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-md-6 themed-grid-col">git push</div>
<div class="col-6 themed-grid-col">Push changes to remote repository and remember branch</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git checkout [branch name]</div>
<div class="col-6 themed-grid-col">Switch to another branch</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-md-6 themed-grid-col">git push origin --delete [branch name]</div>
<div class="col-6 ">Deletes remote branch</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 ">git checkout -</div>
<div class="col-6 ">Switch back to last branch checked out</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git pull</div>
<div class="col-6 themed-grid-col">Updates local repository to latest commit</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git checkout -- "filename.txt" </div>
<div class="col-6 themed-grid-col">Discard changes to a file</div>
</div>
</td>
</tr>
<tr>
<td>
<div class = "row mb-3">
<div class="col-md-6 themed-grid-col">git pull origin [branch name] </div>
<div class="col-6 themed-grid-col">Pull changes from remote repository</div>
</div>
</td>
<td> <div class="row mb-3">
<div class="col-md-6 themed-grid-col">git merge [branch name] </div>
<div class="col-6 themed-grid-col">Merge a branch into active branch</div>
</div></td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-md-6 themed-grid-col">git remote add origin "link"</div>
<div class="col-6 themed-grid-col">Adds remote repository</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 themed-grid-col">git merge [source branch] [target branch]</div>
<div class="col-6 themed-grid-col">Merge a branch into target branch</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-md-6 themed-grid-col">git remote set-url origin "link"</div>
<div class="col-6 ">Sets repository's origin branch to link</div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 ">git stash</div>
<div class="col-6 ">Stash changes in a dirty working directory</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="row">
<div class="col-md-6 themed-grid-col"></div>
<div class="col-6 "></div>
</div>
</td>
<td>
<div class="row mb-3">
<div class="col-md-6 ">git stash clear</div>
<div class="col-6 ">Removes all stashed entries</div>
</div>
</td>
</tr>
</tbody>
</table>
<p style = "text-align:left";>*link = "ssh://git@github.com/[username]/[repository-name].git"</p>
</div>
</main>
<br>
<footer class = "mastfoot mt-auto">
<div class = "inner">
<p class = "design"> Design by Terrence A.T
</p>
</div>
</body>
</html>