-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfreecodecamp_Git.txt
2397 lines (2064 loc) · 94.6 KB
/
freecodecamp_Git.txt
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
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"_comment": "create an object with a reference for how to create a database & Make sure there's 'one empty line at the bottom of the file' and 'no extra spaces after any values' or 'any of the curly brackets'.",
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
}
"_comment2": "Add a 'drop' key to the 'table' object of your JSON file. Give it a value for how to drop a table.",
"table": {
"create": "CREATE TABLE table_name;",
"drop": "DROP TABLE table_name;"
},
"_comment3": "Add a column key to your JSON object. Make it an object like the other two. Give it a single property, add, that has the value 'ALTER TABLE table_name ADD COLUMN column_name;'",
"column": {
"add": "ALTER TABLE table_name ADD COLUMN column_name;"
}
}
*************************************************************************************************
codeally@57d64c1ecb77:~/project$ echo hello git
hello git
codeally@57d64c1ecb77:~/project$ mkdir sql_reference
codeally@57d64c1ecb77:~/project$ cd sql_reference
codeally@57d64c1ecb77:~/project/sql_reference$ git intit
git: 'intit' is not a git command. See 'git --help'.
The most similar command is
init
codeally@57d64c1ecb77:~/project/sql_reference$ git init
Initialized empty Git repository in /home/codeally/project/sql_reference/.git/
codeally@57d64c1ecb77:~/project/sql_reference$ -a
bash: -a: command not found
codeally@57d64c1ecb77:~/project/sql_reference$ ls -a
. .. .git
codeally@57d64c1ecb77:~/project/sql_reference$ git status
On branch master
No commits yet
nothing to commit (create/copy files and use "git add" to track)
codeally@57d64c1ecb77:~/project/sql_reference$ git checkout -b main
Switched to a new branch 'main'
codeally@57d64c1ecb77:~/project/sql_reference$ git status
On branch main
No commits yet
nothing to commit (create/copy files and use "git add" to track)
codeally@57d64c1ecb77:~/project/sql_reference$ touch README.md
codeally@57d64c1ecb77:~/project/sql_reference$
v
SQL Reference
v
codeally@57d64c1ecb77:~/project/sql_reference$ git status
On branch main
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
README.md
nothing added to commit but untracked files present (use "git add" to track)
codeally@57d64c1ecb77:~/project/sql_reference$ git add README.md
codeally@57d64c1ecb77:~/project/sql_reference$ git status
On branch main
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: README.md
codeally@57d64c1ecb77:~/project/sql_reference$ touch sqlreference.json
codeally@57d64c1ecb77:~/project/sql_reference$ ls
README.md sqlreference.json
codeally@57d64c1ecb77:~/project/sql_reference$ rm sql_reference.json
rm: cannot remove 'sql_reference.json': No such file or directory
codeally@57d64c1ecb77:~/project/sql_reference$ rm sqlreference.json
codeally@57d64c1ecb77:~/project/sql_reference$ touch sql_reference.json
codeally@57d64c1ecb77:~/project/sql_reference$ git status
On branch main
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: README.md
Untracked files:
(use "git add <file>..." to include in what will be committed)
sql_reference.json
codeally@57d64c1ecb77:~/project/sql_reference$ git add sql_reference.json
codeally@57d64c1ecb77:~/project/sql_reference$ git status
On branch main
No commits yet
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: README.md
new file: sql_reference.json
codeally@57d64c1ecb77:~/project/sql_reference$ git commit -m "Initial commit"
[main (root-commit) 80cea90] Initial commit
2 files changed, 1 insertion(+)
create mode 100644 README.md
create mode 100644 sql_reference.json
codeally@57d64c1ecb77:~/project/sql_reference$ git status
On branch main
nothing to commit, working tree clean
codeally@57d64c1ecb77:~/project/sql_reference$ git log
commit 80cea90b39b1db6313b02437bedce749c61118ff (HEAD -> main)
Author: Liebmann5 <[email protected]>
Date: Thu Aug 11 21:41:17 2022 +0000
Initial commit
codeally@57d64c1ecb77:~/project/sql_reference$
v
{
"_comment": "create an object with a reference for how to create a database & Make sure there's one empty line at the bottom of the file and no extra spaces after the value or any of the curly brackets.",
"database": {
"create": "CREATE DATABASE database_name;"
}
}
v
codeally@57d64c1ecb77:~/project/sql_reference$ git status
On branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: sql_reference.json
no changes added to commit (use "git add" and/or "git commit -a")
codeally@57d64c1ecb77:~/project/sql_reference$ git diff
diff --git a/sql_reference.json b/sql_reference.json
index e69de29..e93ce14 100644
--- a/sql_reference.json
+++ b/sql_reference.json
@@ -0,0 +1,6 @@
+{
+ "_comment": "create an object with a reference for how to create a database & Make sure there's one empty line at the bottom of the file and no extra spaces after the value or any of the curly brackets.",
+ "database": {
+ "create": "CREATE DATABASE database_name;"
+ }
+}
codeally@57d64c1ecb77:~/project/sql_reference$ git add sql_reference.txt
fatal: pathspec 'sql_reference.txt' did not match any files
codeally@57d64c1ecb77:~/project/sql_reference$ git add sql_reference.json
codeally@57d64c1ecb77:~/project/sql_reference$ git status
On branch main
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: sql_reference.json
codeally@57d64c1ecb77:~/project/sql_reference$ git commit -m "feat: add create database reference"
[main 3cfdaeb] feat: add create database reference
1 file changed, 6 insertions(+)
codeally@57d64c1ecb77:~/project/sql_reference$ git log
commit 3cfdaeb63293c389266cbdc45a8d628033b6cb78 (HEAD -> main)
Author: Liebmann5 <[email protected]>
Date: Thu Aug 11 22:16:03 2022 +0000
feat: add create database reference
commit 80cea90b39b1db6313b02437bedce749c61118ff
Author: Liebmann5 <[email protected]>
Date: Thu Aug 11 21:41:17 2022 +0000
Initial commit
codeally@57d64c1ecb77:~/project/sql_reference$
v
{
"_comment": "create an object with a reference for how to create a database & Make sure there's 'one empty line at the bottom of the file' and 'no extra spaces after any values' or 'any of the curly brackets'.",
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
}
}
v
codeally@57d64c1ecb77:~/project/sql_reference$ git status
On branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: sql_reference.json
no changes added to commit (use "git add" and/or "git commit -a")
codeally@57d64c1ecb77:~/project/sql_reference$ git diff
diff --git a/sql_reference.json b/sql_reference.json
index e93ce14..92aef40 100644
--- a/sql_reference.json
+++ b/sql_reference.json
@@ -1,6 +1,7 @@
{
- "_comment": "create an object with a reference for how to create a database & Make sure there's one empty line at the bottom of the file and no extra spaces after the value or any of the curly brackets.",
+ "_comment": "create an object with a reference for how to create a database & Make sure there's 'one empty line at the bottom of the file' and 'no extra spaces after any values' or 'any of the curly brackets'.",
"database": {
- "create": "CREATE DATABASE database_name;"
+ "create": "CREATE DATABASE database_name;",
+ "drop": "DROP DATABASE database_name;"
}
}
codeally@57d64c1ecb77:~/project/sql_reference$ git add sql_reference.json
codeally@57d64c1ecb77:~/project/sql_reference$ git commit -m "feat: add drop database reference"
[main ad4bd68] feat: add drop database reference
1 file changed, 3 insertions(+), 2 deletions(-)
codeally@57d64c1ecb77:~/project/sql_reference$ git log
commit ad4bd681acc25c2be75c3a10509057826f686356 (HEAD -> main)
Author: Liebmann5 <[email protected]>
Date: Thu Aug 11 23:33:30 2022 +0000
feat: add drop database reference
commit 3cfdaeb63293c389266cbdc45a8d628033b6cb78
Author: Liebmann5 <[email protected]>
Date: Thu Aug 11 22:16:03 2022 +0000
feat: add create database reference
commit 80cea90b39b1db6313b02437bedce749c61118ff
Author: Liebmann5 <[email protected]>
Date: Thu Aug 11 21:41:17 2022 +0000
Initial commit
codeally@57d64c1ecb77:~/project/sql_reference$ git branch
* main
codeally@57d64c1ecb77:~/project/sql_reference$ feat/add-create-table-reference
bash: feat/add-create-table-reference: No such file or directory
codeally@57d64c1ecb77:~/project/sql_reference$ git branch feat/add-create-table-reference
codeally@57d64c1ecb77:~/project/sql_reference$ git branch
feat/add-create-table-reference
* main
codeally@57d64c1ecb77:~/project/sql_reference$
v
___________________________________________________________________________________________________(VERY WRONG)
codeally@412948a3199f:~/project$ git branch
* master
codeally@412948a3199f:~/project$ git checkout feat/add-create-table-reference
error: pathspec 'feat/add-create-table-reference' did not match any file(s) known to git
codeally@412948a3199f:~/project$ git branch main
codeally@412948a3199f:~/project$ git branch *
fatal: Not a valid object name: 'sql_reference'.
codeally@412948a3199f:~/project$ git branch feat/add-create-table-reference
codeally@412948a3199f:~/project$ git branch
feat/add-create-table-reference
main
* master
codeally@412948a3199f:~/project$ git checkout feat/add-create-table-reference
M .freeCodeCamp/test/.cwd
M .freeCodeCamp/test/.next_command
Switched to branch 'feat/add-create-table-reference'
_________________________________________________________________________________________________________________
codeally@412948a3199f:~/project$ ls
learn-git-by-building-an-sql-reference-object sql_reference
codeally@412948a3199f:~/project$ cd sql_reference
codeally@412948a3199f:~/project/sql_reference$ ls
README.md sql_reference.json
codeally@412948a3199f:~/project/sql_reference$ git branch
feat/add-create-table-reference
* main
codeally@412948a3199f:~/project/sql_reference$ git checkout feat/add-create-table-reference
Switched to branch 'feat/add-create-table-reference'
codeally@412948a3199f:~/project/sql_reference$ git branch
* feat/add-create-table-reference
main
codeally@412948a3199f:~/project/sql_reference$
v
{
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
"table": {
"create": "CREATE TABLE table_name;"
}
}
v
codeally@412948a3199f:~/project/sql_reference$ git status
On branch feat/add-create-table-reference
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: sql_reference.json
no changes added to commit (use "git add" and/or "git commit -a")
codeally@412948a3199f:~/project/sql_reference$ git diff
diff --git a/sql_reference.json b/sql_reference.json
index 229e300..4cdfce4 100644
--- a/sql_reference.json
+++ b/sql_reference.json
@@ -2,5 +2,9 @@
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
+ },
+
+ "table": {
+ "create": "CREATE TABLE table_name;"
}
}
codeally@412948a3199f:~/project/sql_reference$ git add sql_reference.json
codeally@412948a3199f:~/project/sql_reference$ git commit -m "feat: add create table reference
> "
[feat/add-create-table-reference 7755ec9] feat: add create table reference
1 file changed, 4 insertions(+)
codeally@412948a3199f:~/project/sql_reference$ git log
commit 7755ec953cafd51a81ea93f8ef2afe5450cc4e50 (HEAD -> feat/add-create-table-reference)
Author: Liebmann5 <[email protected]>
Date: Fri Aug 12 19:21:50 2022 +0000
feat: add create table reference
commit 684afe786ecb33e590f7dd03d9d53b6b7770684d (main)
Author: moT01 <[email protected]>
Date: Thu Sep 9 21:51:05 2021 -0500
feat: add drop database reference
commit a5de9441f554604a1418a7ea46d836ea9ca09613
Author: moT01 <[email protected]>
Date: Thu Sep 9 21:48:34 2021 -0500
feat: add create database reference
commit a029be197bbd18f51b3ec6647391739d2928415e
Author: moT01 <[email protected]>
Date: Thu Sep 9 21:44:23 2021 -0500
Initial commit
codeally@412948a3199f:~/project/sql_reference$ git log --online
fatal: unrecognized argument: --online
codeally@412948a3199f:~/project/sql_reference$ git log --oneline
7755ec9 (HEAD -> feat/add-create-table-reference) feat: add create table reference
684afe7 (main) feat: add drop database reference
a5de944 feat: add create database reference
a029be1 Initial commit
codeally@412948a3199f:~/project/sql_reference$ git checkout main
Switched to branch 'main'
codeally@412948a3199f:~/project/sql_reference$ git log
commit 684afe786ecb33e590f7dd03d9d53b6b7770684d (HEAD -> main)
Author: moT01 <[email protected]>
Date: Thu Sep 9 21:51:05 2021 -0500
feat: add drop database reference
commit a5de9441f554604a1418a7ea46d836ea9ca09613
Author: moT01 <[email protected]>
Date: Thu Sep 9 21:48:34 2021 -0500
feat: add create database reference
commit a029be197bbd18f51b3ec6647391739d2928415e
Author: moT01 <[email protected]>
Date: Thu Sep 9 21:44:23 2021 -0500
Initial commit
codeally@412948a3199f:~/project/sql_reference$ git log --oneline
684afe7 (HEAD -> main) feat: add drop database reference
a5de944 feat: add create database reference
a029be1 Initial commit
codeally@412948a3199f:~/project/sql_reference$ git branch
feat/add-create-table-reference
* main
codeally@412948a3199f:~/project/sql_reference$ git merge feat/add-create-table-reference
Updating 684afe7..7755ec9
Fast-forward
sql_reference.json | 4 ++++
1 file changed, 4 insertions(+)
codeally@412948a3199f:~/project/sql_reference$ git log --oneline
7755ec9 (HEAD -> main, feat/add-create-table-reference) feat: add create table reference
684afe7 feat: add drop database reference
a5de944 feat: add create database reference
a029be1 Initial commit
codeally@412948a3199f:~/project/sql_reference$ git branch -d feat/add-create-table-reference
Deleted branch feat/add-create-table-reference (was 7755ec9).
codeally@412948a3199f:~/project/sql_reference$ git branch
* main
codeally@412948a3199f:~/project/sql_reference$ git checkout -b feat/add-drop-table-reference
Switched to a new branch 'feat/add-drop-table-reference'
codeally@412948a3199f:~/project/sql_reference$
v
{
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
"_comment": "Add a 'drop' key to the 'table' object of your JSON file. Give it a value for how to drop a table.",
"table": {
"create": "CREATE TABLE table_name;",
"drop": "DROP TABLE table_name;"
}
}
v
codeally@412948a3199f:~/project/sql_reference$ git status
On branch feat/add-drop-table-reference
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: sql_reference.json
no changes added to commit (use "git add" and/or "git commit -a")
codeally@412948a3199f:~/project/sql_reference$ git diff
diff --git a/sql_reference.json b/sql_reference.json
index 4cdfce4..3f5148a 100644
--- a/sql_reference.json
+++ b/sql_reference.json
@@ -3,8 +3,10 @@
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
-
+
+ "_comment": "Add a 'drop' key to the 'table' object of your JSON file. Give it a value for how to drop a table.",
"table": {
- "create": "CREATE TABLE table_name;"
+ "create": "CREATE TABLE table_name;",
+ "drop": "DROP TABLE table_name;"
}
}
codeally@412948a3199f:~/project/sql_reference$ git add sql_references.json
fatal: pathspec 'sql_references.json' did not match any files
codeally@412948a3199f:~/project/sql_reference$ git add sql_reference.json
codeally@412948a3199f:~/project/sql_reference$ git commit -m "feat: add drop table reference"
[feat/add-drop-table-reference ef2f251] feat: add drop table reference
1 file changed, 4 insertions(+), 2 deletions(-)
codeally@412948a3199f:~/project/sql_reference$ git checkout main
Switched to branch 'main'
codeally@412948a3199f:~/project/sql_reference$ git branch
feat/add-drop-table-reference
* main
codeally@412948a3199f:~/project/sql_reference$
codeally@412948a3199f:~/project/sql_reference$ git merge feat/add-drop-table-reference
Updating 7755ec9..ef2f251
Fast-forward
sql_reference.json | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
codeally@412948a3199f:~/project/sql_reference$ git branch -d feat/add-drop-table-reference
Deleted branch feat/add-drop-table-reference (was ef2f251).
codeally@412948a3199f:~/project/sql_reference$ git checkout -b feat/add-column-references
Switched to a new branch 'feat/add-column-references'
codeally@412948a3199f:~/project/sql_reference$
v
{
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
"_comment2": "Add a 'drop' key to the 'table' object of your JSON file. Give it a value for how to drop a table.",
"table": {
"create": "CREATE TABLE table_name;",
"drop": "DROP TABLE table_name;"
},
"_comment3": "Add a column key to your JSON object. Make it an object like the other two. Give it a single property, add, that has the value 'ALTER TABLE table_name ADD COLUMN column_name;'",
"column": {
"add": "ALTER TABLE table_name ADD COLUMN column_name;"
}
}
v
codeally@412948a3199f:~/project/sql_reference$ git diff
diff --git a/sql_reference.json b/sql_reference.json
index 3f5148a..2d390d3 100644
--- a/sql_reference.json
+++ b/sql_reference.json
@@ -3,10 +3,11 @@
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
-
- "_comment": "Add a 'drop' key to the 'table' object of your JSON file. Give it a value for how to drop a table.",
"table": {
"create": "CREATE TABLE table_name;",
"drop": "DROP TABLE table_name;"
+ },
+ "column": {
+ "add": "ALTER TABLE table_name ADD COLUMN column_name;"
}
}
codeally@412948a3199f:~/project/sql_reference$ git add .
codeally@412948a3199f:~/project/sql_reference$ git commit -m "feat: add column reference"
[feat/add-column-references 9af453f] feat: add column reference
1 file changed, 3 insertions(+), 2 deletions(-)
codeally@412948a3199f:~/project/sql_reference$ git log --oneline
9af453f (HEAD -> feat/add-column-references) feat: add column reference
ef2f251 (main) feat: add drop table reference
7755ec9 feat: add create table reference
684afe7 feat: add drop database reference
a5de944 feat: add create database reference
a029be1 Initial commit
codeally@412948a3199f:~/project/sql_reference$ git checkout main
Switched to branch 'main'
codeally@412948a3199f:~/project/sql_reference$ git checkout -b feat/create-table-syntax
Switched to a new branch 'feat/create-table-syntax'
codeally@412948a3199f:~/project/sql_reference$ git branch -d feat/create-table-syntax
error: Cannot delete branch 'feat/create-table-syntax' checked out at '/home/codeally/project/sql_reference'
codeally@412948a3199f:~/project/sql_reference$ git branch
feat/add-column-references
* feat/create-table-syntax
main
codeally@412948a3199f:~/project/sql_reference$ git checkout main
Switched to branch 'main'
codeally@412948a3199f:~/project/sql_reference$ git branch -d feat/create-table-syntax
Deleted branch feat/create-table-syntax (was ef2f251).
codeally@412948a3199f:~/project/sql_reference$ git checkout -b fix/create-table-syntax
Switched to a new branch 'fix/create-table-syntax'
codeally@412948a3199f:~/project/sql_reference$
v
{
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
"table": {
"create": "CREATE TABLE table_name();",
"drop": "DROP TABLE table_name;"
}
}
v
***************************************************************************************************************
THE table.create VALUE
***************************************************************************************************************
codeally@412948a3199f:~/project/sql_reference$ git status
On branch fix/create-table-syntax
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: sql_reference.json
no changes added to commit (use "git add" and/or "git commit -a")
codeally@412948a3199f:~/project/sql_reference$ git diff
diff --git a/sql_reference.json b/sql_reference.json
index 3f5148a..11761b7 100644
--- a/sql_reference.json
+++ b/sql_reference.json
@@ -3,10 +3,8 @@
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
-
- "_comment": "Add a 'drop' key to the 'table' object of your JSON file. Give it a value for how to drop a table.",
"table": {
- "create": "CREATE TABLE table_name;",
+ "create": "CREATE TABLE table_name();",
"drop": "DROP TABLE table_name;"
}
}
codeally@412948a3199f:~/project/sql_reference$ git add .
codeally@412948a3199f:~/project/sql_reference$ git commit -m "fix:create table syntax"
[fix/create-table-syntax 4368981] fix:create table syntax
1 file changed, 1 insertion(+), 3 deletions(-)
codeally@412948a3199f:~/project/sql_reference$ git reset HEAD~1
Unstaged changes after reset:
M sql_reference.json
codeally@412948a3199f:~/project/sql_reference$ git status
On branch fix/create-table-syntax
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: sql_reference.json
no changes added to commit (use "git add" and/or "git commit -a")
codeally@412948a3199f:~/project/sql_reference$ git diff
diff --git a/sql_reference.json b/sql_reference.json
index 3f5148a..11761b7 100644
--- a/sql_reference.json
+++ b/sql_reference.json
@@ -3,10 +3,8 @@
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
-
- "_comment": "Add a 'drop' key to the 'table' object of your JSON file. Give it a value for how to drop a table.",
"table": {
- "create": "CREATE TABLE table_name;",
+ "create": "CREATE TABLE table_name();",
"drop": "DROP TABLE table_name;"
}
}
codeally@412948a3199f:~/project/sql_reference$ git add .
codeally@412948a3199f:~/project/sql_reference$ git commit -m "fix: create table syntax"
[fix/create-table-syntax 9bd34ab] fix: create table syntax
1 file changed, 1 insertion(+), 3 deletions(-)
codeally@412948a3199f:~/project/sql_reference$ git checkout main
Switched to branch 'main'
codeally@412948a3199f:~/project/sql_reference$ git branch
feat/add-column-references
fix/create-table-syntax
* main
codeally@412948a3199f:~/project/sql_reference$ git merge fix/create-table-syntax
Updating ef2f251..9bd34ab
Fast-forward
sql_reference.json | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
codeally@412948a3199f:~/project/sql_reference$ git log --oneline
9bd34ab (HEAD -> main, fix/create-table-syntax) fix: create table syntax
ef2f251 feat: add drop table reference
7755ec9 feat: add create table reference
684afe7 feat: add drop database reference
a5de944 feat: add create database reference
a029be1 Initial commit
codeally@412948a3199f:~/project/sql_reference$ git branch -d fix/create-table-syntax
Deleted branch fix/create-table-syntax (was 9bd34ab).
codeally@412948a3199f:~/project/sql_reference$ git checkout feat/add-column-references
Switched to branch 'feat/add-column-references'
codeally@412948a3199f:~/project/sql_reference$ git log --oneline
9af453f (HEAD -> feat/add-column-references) feat: add column reference
ef2f251 feat: add drop table reference
7755ec9 feat: add create table reference
684afe7 feat: add drop database reference
a5de944 feat: add create database reference
a029be1 Initial commit
codeally@412948a3199f:~/project/sql_reference$ git rebase main
First, rewinding head to replay your work on top of it...
Applying: feat: add column reference
Using index info to reconstruct a base tree...
M sql_reference.json
Falling back to patching base and 3-way merge...
Auto-merging sql_reference.json
codeally@412948a3199f:~/project/sql_reference$ git log --oneline
b062d06 (HEAD -> feat/add-column-references) feat: add column reference
9bd34ab (main) fix: create table syntax
ef2f251 feat: add drop table reference
7755ec9 feat: add create table reference
684afe7 feat: add drop database reference
a5de944 feat: add create database reference
a029be1 Initial commit
codeally@412948a3199f:~/project/sql_reference$
v
{
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
"table": {
"create": "CREATE TABLE table_name();",
"drop": "DROP TABLE table_name;"
},
"column": {
"add": "ALTER TABLE table_name ADD COLUMN column_name;",
"drop": "ALTER TABLE table_name DROP COLUMN column_name;"
}
}
v
codeally@412948a3199f:~/project/sql_reference$ git status
On branch feat/add-column-references
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: sql_reference.json
no changes added to commit (use "git add" and/or "git commit -a")
codeally@412948a3199f:~/project/sql_reference$ git diff
diff --git a/sql_reference.json b/sql_reference.json
index 72cdf00..45ed6b0 100644
--- a/sql_reference.json
+++ b/sql_reference.json
@@ -8,6 +8,7 @@
"drop": "DROP TABLE table_name;"
},
"column": {
- "add": "ALTER TABLE table_name ADD COLUMN column_name;"
+ "add": "ALTER TABLE table_name ADD COLUMN column_name;",
+ "drop": "ALTER TABLE table_name DROP COLUMN column_name;"
}
}
codeally@412948a3199f:~/project/sql_reference$ git add sql_reference.json
codeally@412948a3199f:~/project/sql_reference$ git commit -m "feat: add drop column reference"
[feat/add-column-references b695048] feat: add drop column reference
1 file changed, 2 insertions(+), 1 deletion(-)
codeally@412948a3199f:~/project/sql_reference$ git log
commit b695048f35de714198853efb77459f3c23feb74a (HEAD -> feat/add-column-references)
Author: Liebmann5 <[email protected]>
Date: Fri Aug 12 20:57:02 2022 +0000
feat: add drop column reference
commit b062d0647e00783ed3c8c49c7e03dff9167012af
Author: Liebmann5 <[email protected]>
Date: Fri Aug 12 20:12:16 2022 +0000
feat: add column reference
commit 9bd34ab093861f2742def2849da66c9f5dd92699 (main)
Author: Liebmann5 <[email protected]>
Date: Fri Aug 12 20:39:04 2022 +0000
fix: create table syntax
commit ef2f25137b15d394d3741114e553b799ced22526
Author: Liebmann5 <[email protected]>
Date: Fri Aug 12 19:53:25 2022 +0000
feat: add drop table reference
commit 7755ec953cafd51a81ea93f8ef2afe5450cc4e50
Author: Liebmann5 <[email protected]>
Date: Fri Aug 12 19:21:50 2022 +0000
feat: add create table reference
commit 684afe786ecb33e590f7dd03d9d53b6b7770684d
Author: moT01 <[email protected]>
Date: Thu Sep 9 21:51:05 2021 -0500
feat: add drop database reference
commit a5de9441f554604a1418a7ea46d836ea9ca09613
Author: moT01 <[email protected]>
Date: Thu Sep 9 21:48:34 2021 -0500
feat: add create database reference
commit a029be197bbd18f51b3ec6647391739d2928415e
Author: moT01 <[email protected]>
Date: Thu Sep 9 21:44:23 2021 -0500
Initial commit
codeally@412948a3199f:~/project/sql_reference$ git log --oneline
b695048 (HEAD -> feat/add-column-references) feat: add drop column reference
b062d06 feat: add column reference
9bd34ab (main) fix: create table syntax
ef2f251 feat: add drop table reference
7755ec9 feat: add create table reference
684afe7 feat: add drop database reference
a5de944 feat: add create database reference
a029be1 Initial commit
codeally@412948a3199f:~/project/sql_reference$ git checkout main
Switched to branch 'main'
codeally@412948a3199f:~/project/sql_reference$ git checkout -b feat/add-insert-row-reference
Switched to a new branch 'feat/add-insert-row-reference'
codeally@412948a3199f:~/project/sql_reference$
v
{
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
"table": {
"create": "CREATE TABLE table_name();",
"drop": "DROP TABLE table_name;"
},
"row": {
"insert": "INSERT INTO table_name(columns) VALUES(values);"
}
}
v
codeally@412948a3199f:~/project/sql_reference$ git status
On branch feat/add-insert-row-reference
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: sql_reference.json
no changes added to commit (use "git add" and/or "git commit -a")
codeally@412948a3199f:~/project/sql_reference$ git diff
diff --git a/sql_reference.json b/sql_reference.json
index 11761b7..f39cf0a 100644
--- a/sql_reference.json
+++ b/sql_reference.json
@@ -6,5 +6,8 @@
"table": {
"create": "CREATE TABLE table_name();",
"drop": "DROP TABLE table_name;"
+ },
+ "row": {
+ "insert": "INSERT INTO table_name(columns) VALUES(values);"
}
}
codeally@412948a3199f:~/project/sql_reference$ git add sql_reference.json
codeally@412948a3199f:~/project/sql_reference$ git commit -m "feat: add insert row reference"
[feat/add-insert-row-reference 939be6b] feat: add insert row reference
1 file changed, 3 insertions(+)
codeally@412948a3199f:~/project/sql_reference$ git checkout main
Switched to branch 'main'
codeally@412948a3199f:~/project/sql_reference$ git branch
feat/add-column-references
feat/add-insert-row-reference
* main
codeally@412948a3199f:~/project/sql_reference$ git merge feat/add-insert-row-reference
Updating 9bd34ab..939be6b
Fast-forward
sql_reference.json | 3 +++
1 file changed, 3 insertions(+)
codeally@412948a3199f:~/project/sql_reference$ git log
commit 939be6b06b88861d703c222c7cde239dfdb14c7e (HEAD -> main, feat/add-insert-row-reference)
Author: Liebmann5 <[email protected]>
Date: Fri Aug 12 21:40:15 2022 +0000
feat: add insert row reference
commit 9bd34ab093861f2742def2849da66c9f5dd92699
Author: Liebmann5 <[email protected]>
Date: Fri Aug 12 20:39:04 2022 +0000
fix: create table syntax
commit ef2f25137b15d394d3741114e553b799ced22526
Author: Liebmann5 <[email protected]>
Date: Fri Aug 12 19:53:25 2022 +0000
feat: add drop table reference
commit 7755ec953cafd51a81ea93f8ef2afe5450cc4e50
codeally@412948a3199f:~/project/sql_reference$ git log --oneline
939be6b (HEAD -> main, feat/add-insert-row-reference) feat: add insert row reference
9bd34ab fix: create table syntax
ef2f251 feat: add drop table reference
7755ec9 feat: add create table reference
684afe7 feat: add drop database reference
a5de944 feat: add create database reference
a029be1 Initial commit
codeally@412948a3199f:~/project/sql_reference$ git checkout feat/add-column-references
Switched to branch 'feat/add-column-references'
codeally@412948a3199f:~/project/sql_reference$ git rebase main
First, rewinding head to replay your work on top of it...
Applying: feat: add column reference
Using index info to reconstruct a base tree...
M sql_reference.json
Falling back to patching base and 3-way merge...
Auto-merging sql_reference.json
CONFLICT (content): Merge conflict in sql_reference.json
error: Failed to merge in the changes.
Patch failed at 0001 feat: add column reference
hint: Use 'git am --show-current-patch' to see the failed patch
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
codeally@412948a3199f:~/project/sql_reference$
v
{
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
"table": {
"create": "CREATE TABLE table_name();",
"drop": "DROP TABLE table_name;"
},
<<<<<<< HEAD
"row": {
"insert": "INSERT INTO table_name(columns) VALUES(values);"
=======
"column": {
"add": "ALTER TABLE table_name ADD COLUMN column_name;"
>>>>>>> feat: add column reference
}
}
v
{
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
"table": {
"create": "CREATE TABLE table_name();",
"drop": "DROP TABLE table_name;"
},
"row": {
"insert": "INSERT INTO table_name(columns) VALUES(values);"
},
"column": {
"add": "ALTER TABLE table_name ADD COLUMN column_name;"
}
}
v
{My code didn't match during this part (idk why?) so I just kept resetting & then CodeAlly kicked me out}
{WAIITTT I believe I was right because I think my code matches them right before at "The confict arose because the first commit"}
"
Check your status.
It says that you are still in the middle of rebasing and there's one file that needs to be merged yet. Add the file to staging like you would any other commit.
Check your status again.
You fixed the conflicts that arose from trying to add this commit and added them to staging. It says all conflicts fixed: run "git rebase --continue". Run the suggested command to continue the rebase.
The last commit was added after you continued the rebase without conflict. The rebase is now finished. View your log with the oneline flag.
"
v
{
"database": {
"create": "CREATE DATABASE database_name;",
"drop": "DROP DATABASE database_name;"
},
"table": {
"create": "CREATE TABLE table_name();",
"drop": "DROP TABLE table_name;"
},
"row": {
"insert": "INSERT INTO table_name(columns) VALUES(values);"
},
"column": {
"add": "ALTER TABLE table_name ADD COLUMN column_name;",
"drop": "ALTER TABLE table_name DROP COLUMN column_name;",
"rename": "ALTER TABLE table_name RENAME COLUMN column_name TO new_name;"
}
}
v
{My return after CodeAlly kicked me out}