-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
582 lines (382 loc) · 22.2 KB
/
Copy pathindex.html
File metadata and controls
582 lines (382 loc) · 22.2 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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<meta name="keywords" content="">
<title>Git Commandline tutorial</title>
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/stroke.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/animate.css">
<link rel="stylesheet" type="text/css" href="css/prettyPhoto.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="js/syntax-highlighter/styles/shCore.css" media="all">
<link rel="stylesheet" type="text/css" href="js/syntax-highlighter/styles/shThemeRDark.css" media="all">
<!-- CUSTOM -->
<link rel="stylesheet" type="text/css" href="css/custom.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="wrapper">
<div class="container">
<section id="top" class="section docs-heading">
<div class="row">
<div class="col-md-12">
<div class="big-title text-center">
<h1>Git Commandline Documentation</h1>
</div>
<!-- end title -->
</div>
<!-- end 12 -->
</div>
<!-- end row -->
<hr>
</section>
<!-- end section -->
<div class="row">
<div class="col-md-3">
<nav class="docs-sidebar" data-spy="affix" data-offset-top="300" data-offset-bottom="200" role="navigation">
<ul class="nav">
<li><a href="#introduction">Introduction</a></li>
<li><a href="#line1">Getting Started</a></li>
<li><a href="#line2">Using Git on existing code</a></li>
<li><a href="#line3">Using online repositories</a></li>
<li><a href="#line4">Common workflow</a></li>
<li><a href="#line5">Summary / cheatsheet </a></li>
</ul>
</nav >
</div>
<div class="col-md-9">
<section id="introduction" class="welcome">
<div class="row">
<div class="col-md-12 left-align">
<h2 class="dark-text">Introduction<hr></h2>
<div class="row">
<div class="col-md-12 full">
<div>
<p>This documentation is to help you regarding each step of the git commandline. Basic Git and command line (unix) knowledge is required to understand the fundamentals of the commandline.</p>
<h4>Requirements</h4>
<p>You will need the following sofwares to use Git.</p>
<ol>
<li>Git (Download: <a href="https://git-scm.com/download/win" target="_blank">Windows</a>) </li>
<li>Code Editing Software (eg: Dreamweaver, Sublime Text or Notepad)</li>
<li>Web Browser for testing (eg: Google Chrome or Mozilla Firefox)</li>
<li>FTP Tool to upload files to Server (eg: <a href="https://filezilla-project.org/download.php?type=client" target="_blank">FileZilla</a>) </li>
</ol>
</div>
</div>
</div>
<!-- end row -->
</div>
</div>
</section>
<section id="line1" class="section">
<div class="row">
<div class="col-md-12 left-align">
<h2 class="dark-text">Getting Started<hr></h2>
</div>
<!-- end col -->
</div>
<!-- end row -->
<div class="row">
<div class="col-md-12">
<h4>Check version in git</h4>
<pre class="brush: html; highlight: [2,4]">
git --version
// if it went well you should get this as return:
git version 2.19.1.windows.1
</pre>
<h4>Config values in Git</h4>
<pre class="brush: html">
// we use this to define our name when we commit or if people
// are wondering who did what when using git status
git config --global user.name "Jantje"
git config --global user.email "jantje@worldwideweb.com"
// when you done that use:
git config --list
// and if that goes well you will get this returned:
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
http.sslbackend=openssl
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
credential.helper=manager
rebase.usebuiltin=true
stash.usebuiltin=true
core.autocrlf=true
core.excludesfile=C:\Users\Reda\Documents\gitignore_global.txt
user.name=Reda
user.email=reda@worldwideweb.com
</pre>
<h4>Help in Git</h4>
<pre class="brush: html">
git help config
git config --help
//both do the same
</pre>
</div>
<!-- end col -->
</div>
<!-- end row -->
</section>
<!-- end section -->
<section id="line2" class="section">
<div class="row">
<div class="col-md-12 left-align">
<h2 class="dark-text">Creating a git repo from existing code<hr></h2>
</div>
<!-- end col -->
</div>
<div class="row">
<div class="col-md-12">
<h4>Initialize a git reposository from directory</h4>
<pre class="brush: html; highlight: [2,4]">
// when inside a folder open powershell/cmd whatever (I recommend git bash because of the unix commandline):
git init
// if everything went well you can see a .git file inside of it (enable view hidden files)
// if you want to remove .git from the folder use:
rm -rf .git
//only works with git bash btw
</pre>
<h4>Checking the status in git (to check prev. commits and such)</h4>
<pre class="brush: html">
git status
// as you can see there might not be any thing so you get this as return:
On branch master
No commits yet
</pre>
<h4>Ignore files in Git (so you have a better overview over anything)</h4>
<pre class="brush: html">
// using git bash:
touch .gitignore
// open the .gitignore file in your favourite text editor/IDE
// You can use wildcards with it like, if you don't want .db files like thumbnails .db
// you can add up *.db in your .gitignore file
// but I added .DS_Store .project & *.db
</pre>
<h4>Checking the status in git and commit/undo the changes</h4>
<pre class="brush: html">
git status
// as you can see there isn't any file in the list anymore that ends with
// *.db
// .DS_Store or what ever you put to hide.
// now we will have to update our git repository
git add -A
// then
git status
// now you can see a lot of files in staging area or just a little depends
// on how many files you added to it.
// if you made a mistake and want to undo real quick because theres one file you didn't
// want to commit use
git reset [filename]
// then do
git status
// now you can see the file is back at untracked files.
//what you want to do now to commit the changes to the repository
git commit -m "Initial commit"
// between the "" is a message, you want to be detailed
// now use
git log
// so you can see the logs of what someone did you should get this in return:
Author: Reda iredaah@gmail.com
Date: Wed Nov 7 14:44:25 2018 +0100
Initial commit
</pre>
</div>
<!-- end col -->
</div>
<!-- end row -->
</section>
<!-- end section -->
<section id="line3" class="section">
<div class="row">
<div class="col-md-12 left-align">
<h2 class="dark-text">Using online repositories<hr></h2>
</div>
<div class="row">
<div class="col-md-12">
<h4>Initialize a git reposository online</h4>
<pre class="brush: html; highlight: [2,4]">
// when inside a folder open powershell/cmd whatever (I recommend git bash because of the unix commandline):
git clone [url] .
// the dot stands for in this directory
// so basically you do this:
git clone https://github.com/surjithctly/documentation-html-template.git .
// then you should get this returned:
Cloning into '.'...
remote: Enumerating objects: 185, done.
remote: Total 185 (delta 0), reused 0 (delta 0), pack-reused 185
Receiving objects: 100% (185/185), 2.77 MiB | 502.00 KiB/s, done.
Resolving deltas: 100% (55/55), done.
</pre>
<h4>Viewing information about the remote repositiory</h4>
<pre class="brush: html">
git remote -v
// List all currently configured remotes
// for the repository i cloned i have this as return :
origin https://github.com/surjithctly/documentation-html-template.git (fetch)
origin https://github.com/surjithctly/documentation-html-template.git (push)
git branch -a
// List all existing branches
// for the repository i cloned i have this as return :
remotes/origin/HEAD -> origin/master
remotes/origin/gh-pages
remotes/origin/master
//those are the branches I have
</pre>
<h4>Pushing files on a remote repositiory</h4>
<pre class="brush: html">
// make a small change to a file in a file inside of the dir.
// then
git diff
// you can see you made a change now
// you can see "+" means added and "-" means removed
diff --git a/index.html b/index.html
index 99de887..2e5a810 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,6 @@
<!--<![endif]-->
@@ -64,7 +63,7 @@
<!-- end section -->
-
+this is a test
// now check status
git status
// commit
git add -A
git commit -m "this is a test"
//now you push it to the master branch
git pull origin master
git push origin master
</pre>
</div>
</div>
<!-- end col -->
</div>
<!-- end row -->
</section>
<!-- end section -->
<section id="line4" class="section">
<div class="row">
<div class="col-md-12 left-align">
<h2 class="dark-text">Common workflows<hr></h2>
</div>
<!-- end col -->
</div>
<div class="row">
<div class="col-md-12">
<h4>Create a branch for desired feature</h4>
<pre class="brush: html; highlight: [2,4]">
// lets say you want a branch and you only work on that one thing
git branch thing
// show all branches there is
git branch
// to go into the "thing"-branch
git checkout thing
//make a change in the file
// check status and the changes
git status
git diff
// it should return the changes you made
-
+this is a test branch lol.
//now commit the change
git add -A
git commit -m "this is a test branch"
// should return
[thing e858961] this is a test branch
1 file changed, 1 insertion(+), 2 deletions(-)
</pre>
<h4>After commit commit push branch to remote</h4>
<pre class="brush: html">
git push -u origin thing
git branch -a
// now you pushed it into the origin branch
// now we will merge it with the master branch
git checkout master
// to go to the master branch
git pull origin master
git branch --merged
git merge thing
git push origin master
</pre>
<h4> Deleting the branch after done</h4>
<pre class="brush: html">
// if we are done with this branch we are ready to delete it
git branch --merged
git branch -d thing
git branch -a
git push origin --delete thing
</pre>
</div>
<!-- end col -->
</div>
<!-- end row -->
<!-- end row -->
</section>
<!-- end section -->
<section id="line5" class="section">
<div class="row">
<div class="col-md-12 left-align">
<h2 class="dark-text">Everything. Literally<hr></h2>
</div>
<!-- end col -->
</div>
<!-- end row -->
<div class="row">
<div class="col-md-12">
<a href="https://cdn-07.anonfile.com/X4I5D3k8b9/ca41c28a-1541606009/git-cheatsheet-EN-dark.pdf" target="_blank">click here to install the pdf</a>
</div>
</div>
<!-- end row -->
</section>
<!-- end section -->
</div>
<!-- // end .col -->
</div>
<!-- // end .row -->
</div>
<!-- // end container -->
</div>
<!-- end wrapper -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/retina.js"></script>
<script src="js/jquery.fitvids.js"></script>
<script src="js/wow.js"></script>
<script src="js/jquery.prettyPhoto.js"></script>
<!-- CUSTOM PLUGINS -->
<script src="js/custom.js"></script>
<script src="js/main.js"></script>
<script src="js/syntax-highlighter/scripts/shCore.js"></script>
<script src="js/syntax-highlighter/scripts/shBrushXml.js"></script>
<script src="js/syntax-highlighter/scripts/shBrushCss.js"></script>
<script src="js/syntax-highlighter/scripts/shBrushJScript.js"></script>
</body>
</html>