Repository navigation
Expand file tree
/
Copy pathgit.html
More file actions
1365 lines (1234 loc) Β· 56 KB
/
Copy pathgit.html
File metadata and controls
1365 lines (1234 loc) Β· 56 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Git Commands β Complete Reference</title>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Syne:wght@400;600;700;800&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0d0f17;
--bg2: #13161f;
--bg3: #1a1d2a;
--bg4: #1f2233;
--border: #2a2d3e;
--accent: #f97316;
--accent2: #fb923c;
--green: #22c55e;
--blue: #3b82f6;
--purple: #a855f7;
--red: #ef4444;
--yellow: #eab308;
--cyan: #06b6d4;
--text: #e2e8f0;
--text2: #94a3b8;
--text3: #64748b;
--code-bg: #0a0c13;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
background: var(--bg);
color: var(--text);
font-family: 'Syne', sans-serif;
line-height: 1.6;
overflow-x: hidden;
}
/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
/* HEADER */
.hero {
position: relative;
padding: 80px 40px 60px;
text-align: center;
overflow: hidden;
border-bottom: 1px solid var(--border);
}
.hero::before {
content: '';
position: absolute;
top: -100px; left: 50%;
transform: translateX(-50%);
width: 600px; height: 400px;
background: radial-gradient(ellipse, rgba(249,115,22,0.12) 0%, transparent 70%);
pointer-events: none;
}
.hero-badge {
display: inline-block;
background: rgba(249,115,22,0.1);
border: 1px solid rgba(249,115,22,0.3);
color: var(--accent);
font-family: 'JetBrains Mono', monospace;
font-size: 11px;
padding: 4px 14px;
border-radius: 20px;
letter-spacing: 2px;
text-transform: uppercase;
margin-bottom: 20px;
}
.hero h1 {
font-size: clamp(2.4rem, 6vw, 4.2rem);
font-weight: 800;
line-height: 1.1;
margin-bottom: 16px;
letter-spacing: -1px;
}
.hero h1 span { color: var(--accent); }
.hero p {
color: var(--text2);
font-size: 1.05rem;
max-width: 560px;
margin: 0 auto 32px;
font-weight: 400;
}
/* SEARCH */
.search-wrap {
max-width: 520px;
margin: 0 auto;
position: relative;
}
.search-wrap input {
width: 100%;
background: var(--bg3);
border: 1px solid var(--border);
color: var(--text);
font-family: 'JetBrains Mono', monospace;
font-size: 14px;
padding: 14px 20px 14px 48px;
border-radius: 12px;
outline: none;
transition: border-color 0.2s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--text3); }
.search-icon {
position: absolute;
left: 16px; top: 50%;
transform: translateY(-50%);
color: var(--text3);
font-size: 16px;
}
/* NAV */
.sticky-nav {
position: sticky;
top: 0;
z-index: 100;
background: rgba(13,15,23,0.95);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border);
padding: 0 24px;
overflow-x: auto;
white-space: nowrap;
}
.nav-inner {
display: inline-flex;
gap: 0;
min-width: 100%;
}
.nav-inner a {
display: inline-block;
padding: 14px 16px;
color: var(--text2);
text-decoration: none;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.5px;
text-transform: uppercase;
border-bottom: 2px solid transparent;
transition: all 0.2s;
white-space: nowrap;
}
.nav-inner a:hover { color: var(--accent); border-bottom-color: var(--accent); }
/* MAIN LAYOUT */
.container {
max-width: 1100px;
margin: 0 auto;
padding: 48px 24px;
}
/* SECTION */
.section {
margin-bottom: 64px;
animation: fadeUp 0.5s ease both;
}
@keyframes fadeUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.section-header {
display: flex;
align-items: center;
gap: 14px;
margin-bottom: 28px;
padding-bottom: 16px;
border-bottom: 1px solid var(--border);
}
.section-icon {
width: 44px; height: 44px;
border-radius: 10px;
display: flex; align-items: center; justify-content: center;
font-size: 20px;
flex-shrink: 0;
}
.section-title { font-size: 1.4rem; font-weight: 700; }
.section-subtitle { color: var(--text2); font-size: 0.85rem; font-weight: 400; margin-top: 2px; }
/* COMMAND GRID */
.cmd-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 16px;
}
/* COMMAND CARD */
.cmd-card {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: 14px;
padding: 20px;
transition: border-color 0.2s, transform 0.2s;
position: relative;
overflow: hidden;
}
.cmd-card::before {
content: '';
position: absolute;
top: 0; left: 0; right: 0;
height: 2px;
background: linear-gradient(90deg, transparent, var(--card-accent, var(--accent)), transparent);
opacity: 0;
transition: opacity 0.2s;
}
.cmd-card:hover { border-color: var(--card-accent, var(--accent)); transform: translateY(-2px); }
.cmd-card:hover::before { opacity: 1; }
.cmd-top {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 10px;
gap: 8px;
}
.cmd-name {
font-family: 'JetBrains Mono', monospace;
font-size: 14px;
font-weight: 700;
color: var(--card-accent, var(--accent));
flex: 1;
word-break: break-all;
}
.badge {
font-size: 9px;
font-weight: 700;
padding: 3px 8px;
border-radius: 20px;
letter-spacing: 1px;
text-transform: uppercase;
flex-shrink: 0;
}
.badge-daily { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-important { background: rgba(249,115,22,0.15); color: var(--accent); }
.badge-advanced { background: rgba(168,85,247,0.15); color: var(--purple); }
.badge-beginner { background: rgba(59,130,246,0.15); color: var(--blue); }
.cmd-desc {
color: var(--text2);
font-size: 13px;
margin-bottom: 14px;
line-height: 1.6;
}
.cmd-desc strong { color: var(--text); font-weight: 600; }
.cmd-when {
background: rgba(249,115,22,0.06);
border-left: 2px solid var(--accent);
padding: 8px 12px;
border-radius: 0 6px 6px 0;
font-size: 12px;
color: var(--text2);
margin-bottom: 12px;
}
.cmd-when span { color: var(--accent); font-weight: 600; }
.code-block {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 10px 14px;
font-family: 'JetBrains Mono', monospace;
font-size: 12px;
color: #7dd3fc;
position: relative;
overflow-x: auto;
}
.copy-btn {
position: absolute;
top: 6px; right: 8px;
background: rgba(255,255,255,0.05);
border: 1px solid var(--border);
color: var(--text3);
font-size: 10px;
padding: 3px 8px;
border-radius: 4px;
cursor: pointer;
font-family: 'JetBrains Mono', monospace;
transition: all 0.15s;
}
.copy-btn:hover { background: rgba(249,115,22,0.15); color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--green); border-color: var(--green); background: rgba(34,197,94,0.1); }
/* PROMPT SYMBOL */
.prompt { color: var(--accent); margin-right: 6px; user-select: none; }
.comment { color: var(--text3); }
/* MOST USED SECTION */
.most-used-section {
background: linear-gradient(135deg, var(--bg2), var(--bg3));
border: 1px solid var(--border);
border-radius: 20px;
padding: 40px;
margin-bottom: 64px;
position: relative;
overflow: hidden;
}
.most-used-section::before {
content: 'π₯';
position: absolute;
font-size: 180px;
right: -20px; top: -20px;
opacity: 0.04;
user-select: none;
}
.most-used-title {
font-size: 1.8rem;
font-weight: 800;
margin-bottom: 6px;
}
.most-used-title span { color: var(--accent); }
.most-used-sub {
color: var(--text2);
margin-bottom: 32px;
font-size: 0.9rem;
}
.usage-item {
display: grid;
grid-template-columns: 160px 1fr 60px;
align-items: center;
gap: 16px;
margin-bottom: 16px;
animation: fadeUp 0.4s ease both;
}
.usage-cmd {
font-family: 'JetBrains Mono', monospace;
font-size: 13px;
font-weight: 700;
color: var(--accent);
}
.usage-bar-wrap {
background: var(--bg);
border-radius: 4px;
height: 10px;
overflow: hidden;
border: 1px solid var(--border);
}
.usage-bar {
height: 100%;
border-radius: 4px;
position: relative;
transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.usage-pct {
font-family: 'JetBrains Mono', monospace;
font-size: 11px;
color: var(--text2);
text-align: right;
}
.usage-desc {
font-size: 11px;
color: var(--text3);
margin-top: 4px;
display: none;
}
/* TOP USAGE GRID */
.top-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 14px;
margin-top: 32px;
}
.top-card {
background: var(--bg);
border: 1px solid var(--border);
border-radius: 12px;
padding: 16px 18px;
display: flex;
align-items: center;
gap: 12px;
transition: border-color 0.2s;
}
.top-card:hover { border-color: var(--accent); }
.top-rank {
font-family: 'JetBrains Mono', monospace;
font-size: 22px;
font-weight: 800;
color: var(--border);
min-width: 30px;
}
.top-rank.r1 { color: #fbbf24; }
.top-rank.r2 { color: #94a3b8; }
.top-rank.r3 { color: #cd7c2f; }
.top-info { flex: 1; }
.top-cmd { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; color: var(--text); }
.top-use { font-size: 11px; color: var(--text3); margin-top: 2px; }
/* NO RESULTS */
.no-results {
text-align: center;
padding: 60px 20px;
color: var(--text3);
display: none;
}
.no-results .icon { font-size: 48px; margin-bottom: 12px; }
/* FOOTER */
footer {
border-top: 1px solid var(--border);
padding: 30px 24px;
text-align: center;
color: var(--text3);
font-size: 12px;
font-family: 'JetBrains Mono', monospace;
}
/* RESPONSIVE */
@media(max-width: 640px) {
.hero { padding: 48px 20px 40px; }
.cmd-grid { grid-template-columns: 1fr; }
.usage-item { grid-template-columns: 120px 1fr 50px; }
.most-used-section { padding: 24px; }
.top-grid { grid-template-columns: 1fr 1fr; }
}
/* HIDE during search */
.cmd-card.hidden { display: none; }
.section.all-hidden .cmd-grid-label { display: none; }
</style>
</head>
<body>
<!-- HERO -->
<div class="hero">
<div class="hero-badge">π Complete Reference Guide</div>
<h1>Git Commands<br><span>Poora Guide</span></h1>
<p>Kab kya use karna hai β with examples, Hinglish mein samjho aur pro developer bano π</p>
<div class="search-wrap">
<span class="search-icon">π</span>
<input type="text" id="searchInput" placeholder="Search commands... e.g. 'commit', 'branch'" oninput="filterCommands(this.value)">
</div>
</div>
<!-- STICKY NAV -->
<nav class="sticky-nav">
<div class="nav-inner">
<a href="#setup">βοΈ Setup</a>
<a href="#init">π Init</a>
<a href="#staging">π Staging</a>
<a href="#branching">πΏ Branching</a>
<a href="#merging">π Merging</a>
<a href="#remote">π Remote</a>
<a href="#logs">π Logs</a>
<a href="#undo">β©οΈ Undo</a>
<a href="#stash">ποΈ Stash</a>
<a href="#tags">π·οΈ Tags</a>
<a href="#mostused">π₯ Most Used</a>
</div>
</nav>
<div class="container">
<!-- NO RESULTS -->
<div class="no-results" id="noResults">
<div class="icon">π</div>
<p>Koi command nahi mili "<span id="searchTerm"></span>" ke liye</p>
</div>
<!-- ===== 1. SETUP & CONFIG ===== -->
<div class="section" id="setup">
<div class="section-header">
<div class="section-icon" style="background:rgba(59,130,246,0.1);">βοΈ</div>
<div>
<div class="section-title">Setup & Configuration</div>
<div class="section-subtitle">Pehli baar Git install karne ke baad ye karo β ek baar hi karna hota hai</div>
</div>
</div>
<div class="cmd-grid">
<div class="cmd-card" style="--card-accent: #3b82f6;" data-tags="config name email setup global user">
<div class="cmd-top">
<div class="cmd-name">git config --global user.name</div>
<span class="badge badge-beginner">Beginner</span>
</div>
<div class="cmd-desc">Apna <strong>naam set karo</strong> Git ke liye. Ye naam har commit mein dikhega.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Pehli baar Git install karne ke baad</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git config --global user.name "Rahul Dev"
</div>
</div>
<div class="cmd-card" style="--card-accent: #3b82f6;" data-tags="config email setup global user">
<div class="cmd-top">
<div class="cmd-name">git config --global user.email</div>
<span class="badge badge-beginner">Beginner</span>
</div>
<div class="cmd-desc">Apni <strong>email set karo</strong>. GitHub account wali email dalna best hai.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Username set karne ke turant baad</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git config --global user.email "rahul@example.com"
</div>
</div>
<div class="cmd-card" style="--card-accent: #3b82f6;" data-tags="config list show settings">
<div class="cmd-top">
<div class="cmd-name">git config --list</div>
<span class="badge badge-beginner">Beginner</span>
</div>
<div class="cmd-desc">Saari Git <strong>settings dekho</strong> β name, email, editor sab.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Jab check karna ho ki settings sahi hain ya nahi</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git config --list
</div>
</div>
<div class="cmd-card" style="--card-accent: #3b82f6;" data-tags="config editor vscode nano vim">
<div class="cmd-top">
<div class="cmd-name">git config --global core.editor</div>
<span class="badge badge-beginner">Beginner</span>
</div>
<div class="cmd-desc">Default <strong>editor set karo</strong> commit messages ke liye.</div>
<div class="cmd-when"><span>π Kab use karein:</span> VS Code ya koi aur editor use karna ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git config --global core.editor "code --wait"
</div>
</div>
</div>
</div>
<!-- ===== 2. INIT & CLONE ===== -->
<div class="section" id="init">
<div class="section-header">
<div class="section-icon" style="background:rgba(34,197,94,0.1);">π</div>
<div>
<div class="section-title">Repository Init & Clone</div>
<div class="section-subtitle">Nayi repo shuru karo ya kisi ki copy lo β starting point</div>
</div>
</div>
<div class="cmd-grid">
<div class="cmd-card" style="--card-accent: #22c55e;" data-tags="init initialize new repo start">
<div class="cmd-top">
<div class="cmd-name">git init</div>
<span class="badge badge-beginner">Beginner</span>
</div>
<div class="cmd-desc"><strong>Nayi Git repository</strong> banao current folder mein. Ek hidden <code>.git</code> folder create hota hai.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Jab bilkul naya project shuru karo aur Git tracking chahiye</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>mkdir my-project && cd my-project<br>
<span class="prompt">$</span>git init
</div>
</div>
<div class="cmd-card" style="--card-accent: #22c55e;" data-tags="clone copy download github remote repo">
<div class="cmd-top">
<div class="cmd-name">git clone</div>
<span class="badge badge-beginner">Beginner</span>
</div>
<div class="cmd-desc"><strong>Kisi existing repo ki copy</strong> apne machine pe lo. GitHub/GitLab ka URL use hota hai.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Team ke kisi project mein join karo ya open source contribute karo</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git clone https://github.com/user/repo.git<br>
<span class="comment"># Custom folder name ke saath</span><br>
<span class="prompt">$</span>git clone https://github.com/user/repo.git my-folder
</div>
</div>
</div>
</div>
<!-- ===== 3. STAGING & COMMITS ===== -->
<div class="section" id="staging">
<div class="section-header">
<div class="section-icon" style="background:rgba(249,115,22,0.1);">π</div>
<div>
<div class="section-title">Staging & Commits</div>
<div class="section-subtitle">Roz ka kaam β changes track karo aur save karo</div>
</div>
</div>
<div class="cmd-grid">
<div class="cmd-card" style="--card-accent: #f97316;" data-tags="status check changes modified untracked">
<div class="cmd-top">
<div class="cmd-name">git status</div>
<span class="badge badge-daily">Daily Use</span>
</div>
<div class="cmd-desc"><strong>Current state dekho</strong> β kaunse files changed hain, kaunse staged hain, kaunse untracked hain.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Kuch bhi karne se pehle β situation samajhne ke liye</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git status<br>
<span class="comment"># Short format mein dekhna ho toh</span><br>
<span class="prompt">$</span>git status -s
</div>
</div>
<div class="cmd-card" style="--card-accent: #f97316;" data-tags="add stage file changes track">
<div class="cmd-top">
<div class="cmd-name">git add</div>
<span class="badge badge-daily">Daily Use</span>
</div>
<div class="cmd-desc">Files ko <strong>staging area mein daalo</strong> β matlab commit ke liye ready karo. Soch lo ye "cart mein daalna" hai.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Commit karne se pehle specific ya saari files select karo</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git add index.html <span class="comment"># specific file</span><br>
<span class="prompt">$</span>git add src/ <span class="comment"># poora folder</span><br>
<span class="prompt">$</span>git add . <span class="comment"># saari files</span>
</div>
</div>
<div class="cmd-card" style="--card-accent: #f97316;" data-tags="commit save message snapshot history">
<div class="cmd-top">
<div class="cmd-name">git commit</div>
<span class="badge badge-daily">Daily Use</span>
</div>
<div class="cmd-desc">Staged changes ko <strong>permanently save karo</strong> history mein. Message daalna zaroori hai.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Ek feature/fix complete ho jaye toh commit karo</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git commit -m "Add login page"<br>
<span class="comment"># Add + commit ek saath (tracked files)</span><br>
<span class="prompt">$</span>git commit -am "Fix typo in header"
</div>
</div>
<div class="cmd-card" style="--card-accent: #f97316;" data-tags="commit amend edit last message change">
<div class="cmd-top">
<div class="cmd-name">git commit --amend</div>
<span class="badge badge-important">Important</span>
</div>
<div class="cmd-desc"><strong>Last commit badlo</strong> β message ya files dono. Push karne se pehle hi use karo!</div>
<div class="cmd-when"><span>π Kab use karein:</span> Last commit mein typo ho ya koi file bhool gaye ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git commit --amend -m "Sahi message"<br>
<span class="comment"># File add karke amend karo</span><br>
<span class="prompt">$</span>git add forgotten.js<br>
<span class="prompt">$</span>git commit --amend --no-edit
</div>
</div>
</div>
</div>
<!-- ===== 4. BRANCHING ===== -->
<div class="section" id="branching">
<div class="section-header">
<div class="section-icon" style="background:rgba(34,197,94,0.1);">πΏ</div>
<div>
<div class="section-title">Branching</div>
<div class="section-subtitle">Alag alag features pe parallel kaam karo bina main code touch kiye</div>
</div>
</div>
<div class="cmd-grid">
<div class="cmd-card" style="--card-accent: #22c55e;" data-tags="branch list show all branches">
<div class="cmd-top">
<div class="cmd-name">git branch</div>
<span class="badge badge-daily">Daily Use</span>
</div>
<div class="cmd-desc">Saari <strong>branches dekho ya nayi banao</strong>. Current branch ke aage <code>*</code> hota hai.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Branches list karna ho ya nayi feature branch chahiye ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git branch <span class="comment"># list branches</span><br>
<span class="prompt">$</span>git branch feature-login <span class="comment"># nayi branch</span><br>
<span class="prompt">$</span>git branch -d old-branch <span class="comment"># delete</span><br>
<span class="prompt">$</span>git branch -a <span class="comment"># remote bhi</span>
</div>
</div>
<div class="cmd-card" style="--card-accent: #22c55e;" data-tags="checkout switch branch change move">
<div class="cmd-top">
<div class="cmd-name">git checkout / git switch</div>
<span class="badge badge-daily">Daily Use</span>
</div>
<div class="cmd-desc"><strong>Branch badlo</strong>. Modern Git mein <code>switch</code> prefer karo, <code>checkout</code> purana hai.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Ek feature se doosre feature pe jaana ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git switch feature-login<br>
<span class="comment"># Nayi branch banao + switch ek saath</span><br>
<span class="prompt">$</span>git switch -c feature-payment<br>
<span class="comment"># Purana tarika</span><br>
<span class="prompt">$</span>git checkout -b feature-payment
</div>
</div>
<div class="cmd-card" style="--card-accent: #22c55e;" data-tags="branch rename move">
<div class="cmd-top">
<div class="cmd-name">git branch -m</div>
<span class="badge badge-beginner">Beginner</span>
</div>
<div class="cmd-desc"><strong>Branch ka naam badlo</strong>. Current branch ka naam galat ho gaya toh.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Branch naam mein typo ho ya convention follow karna ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="comment"># Current branch rename karo</span><br>
<span class="prompt">$</span>git branch -m new-name<br>
<span class="comment"># Kisi bhi branch ko rename</span><br>
<span class="prompt">$</span>git branch -m old-name new-name
</div>
</div>
</div>
</div>
<!-- ===== 5. MERGING & REBASING ===== -->
<div class="section" id="merging">
<div class="section-header">
<div class="section-icon" style="background:rgba(168,85,247,0.1);">π</div>
<div>
<div class="section-title">Merging & Rebasing</div>
<div class="section-subtitle">Alag branches ka kaam combine karo β team ka code integrate karo</div>
</div>
</div>
<div class="cmd-grid">
<div class="cmd-card" style="--card-accent: #a855f7;" data-tags="merge combine branch integrate">
<div class="cmd-top">
<div class="cmd-name">git merge</div>
<span class="badge badge-important">Important</span>
</div>
<div class="cmd-desc">Kisi <strong>branch ka kaam current branch mein lao</strong>. Merge commit banta hai history mein.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Feature complete ho jaye toh main/develop mein merge karo</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="comment"># Pehle main branch pe aao</span><br>
<span class="prompt">$</span>git switch main<br>
<span class="comment"># Ab feature branch merge karo</span><br>
<span class="prompt">$</span>git merge feature-login
</div>
</div>
<div class="cmd-card" style="--card-accent: #a855f7;" data-tags="rebase clean history linear">
<div class="cmd-top">
<div class="cmd-name">git rebase</div>
<span class="badge badge-advanced">Advanced</span>
</div>
<div class="cmd-desc">Branch ke commits ko <strong>nayi base pe rakh do</strong> β clean linear history milti hai merge se alag.</div>
<div class="cmd-when"><span>π Kab use karein:</span> History clean rakhni ho aur main pe latest changes leni ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="comment"># feature branch pe hote hue</span><br>
<span class="prompt">$</span>git rebase main<br>
<span class="comment"># Interactive rebase (commits edit karo)</span><br>
<span class="prompt">$</span>git rebase -i HEAD~3
</div>
</div>
<div class="cmd-card" style="--card-accent: #a855f7;" data-tags="cherry-pick specific commit apply">
<div class="cmd-top">
<div class="cmd-name">git cherry-pick</div>
<span class="badge badge-advanced">Advanced</span>
</div>
<div class="cmd-desc"><strong>Sirf ek specific commit</strong> kisi bhi branch se current branch mein lao.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Poori branch nahi, bas ek fix/feature ka commit chahiye</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="comment"># Commit hash pata karo pehle</span><br>
<span class="prompt">$</span>git log --oneline<br>
<span class="prompt">$</span>git cherry-pick a1b2c3d
</div>
</div>
</div>
</div>
<!-- ===== 6. REMOTE ===== -->
<div class="section" id="remote">
<div class="section-header">
<div class="section-icon" style="background:rgba(6,182,212,0.1);">π</div>
<div>
<div class="section-title">Remote Operations</div>
<div class="section-subtitle">GitHub/GitLab ke saath kaam karo β team ke saath sync karo</div>
</div>
</div>
<div class="cmd-grid">
<div class="cmd-card" style="--card-accent: #06b6d4;" data-tags="push upload send remote github origin">
<div class="cmd-top">
<div class="cmd-name">git push</div>
<span class="badge badge-daily">Daily Use</span>
</div>
<div class="cmd-desc">Local commits ko <strong>remote server pe bhejo</strong> (GitHub/GitLab). Backup bhi hota hai.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Kaam complete ho aur team ke saath share karna ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git push origin main<br>
<span class="comment"># Nayi branch push karo</span><br>
<span class="prompt">$</span>git push -u origin feature-login<br>
<span class="comment"># Force push (careful!)</span><br>
<span class="prompt">$</span>git push --force-with-lease
</div>
</div>
<div class="cmd-card" style="--card-accent: #06b6d4;" data-tags="pull download fetch merge remote update">
<div class="cmd-top">
<div class="cmd-name">git pull</div>
<span class="badge badge-daily">Daily Use</span>
</div>
<div class="cmd-desc">Remote se <strong>latest changes lo aur local se merge karo</strong>. fetch + merge dono ek saath.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Kaam shuru karne se pehle ya team ke changes lene ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git pull<br>
<span class="prompt">$</span>git pull origin main<br>
<span class="comment"># Rebase ke saath pull (cleaner)</span><br>
<span class="prompt">$</span>git pull --rebase
</div>
</div>
<div class="cmd-card" style="--card-accent: #06b6d4;" data-tags="fetch remote download check update">
<div class="cmd-top">
<div class="cmd-name">git fetch</div>
<span class="badge badge-important">Important</span>
</div>
<div class="cmd-desc">Remote ki <strong>information lo but merge mat karo</strong>. Safe tarika hai pehle dekho phir decide karo.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Dekhna ho ki remote pe kya naya aaya hai bina merge kiye</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git fetch origin<br>
<span class="comment"># Fetch ke baad diff dekho</span><br>
<span class="prompt">$</span>git diff main origin/main
</div>
</div>
<div class="cmd-card" style="--card-accent: #06b6d4;" data-tags="remote add show origin url">
<div class="cmd-top">
<div class="cmd-name">git remote</div>
<span class="badge badge-beginner">Beginner</span>
</div>
<div class="cmd-desc">Remote connections <strong>manage karo</strong> β add, remove, list karo.</div>
<div class="cmd-when"><span>π Kab use karein:</span> GitHub URL add karna ho ya change karna ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git remote -v <span class="comment"># list</span><br>
<span class="prompt">$</span>git remote add origin https://github.com/u/r.git<br>
<span class="prompt">$</span>git remote remove origin <span class="comment"># remove</span>
</div>
</div>
</div>
</div>
<!-- ===== 7. LOGS & HISTORY ===== -->
<div class="section" id="logs">
<div class="section-header">
<div class="section-icon" style="background:rgba(234,179,8,0.1);">π</div>
<div>
<div class="section-title">Logs & History</div>
<div class="section-subtitle">Past dekho β kya kab hua, kaun ne kya badla</div>
</div>
</div>
<div class="cmd-grid">
<div class="cmd-card" style="--card-accent: #eab308;" data-tags="log history commits list show past">
<div class="cmd-top">
<div class="cmd-name">git log</div>
<span class="badge badge-daily">Daily Use</span>
</div>
<div class="cmd-desc"><strong>Commit history dekho</strong> β kaun ne kab kya commit kiya. Bahut options hain formatting ke liye.</div>
<div class="cmd-when"><span>π Kab use karein:</span> History review karni ho ya commit hash dhundhna ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git log<br>
<span class="comment"># Compact, beautiful format</span><br>
<span class="prompt">$</span>git log --oneline --graph --all<br>
<span class="comment"># Ek author ki commits</span><br>
<span class="prompt">$</span>git log --author="Rahul"
</div>
</div>
<div class="cmd-card" style="--card-accent: #eab308;" data-tags="diff difference changes compare files">
<div class="cmd-top">
<div class="cmd-name">git diff</div>
<span class="badge badge-daily">Daily Use</span>
</div>
<div class="cmd-desc"><strong>Changes dekho</strong> β unstaged, staged ya commits ke beech ka difference.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Commit se pehle exactly kya badla ye dekhna ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git diff <span class="comment"># unstaged changes</span><br>
<span class="prompt">$</span>git diff --staged <span class="comment"># staged changes</span><br>
<span class="comment"># Do branches ka diff</span><br>
<span class="prompt">$</span>git diff main feature-x
</div>
</div>
<div class="cmd-card" style="--card-accent: #eab308;" data-tags="show commit details info">
<div class="cmd-top">
<div class="cmd-name">git show</div>
<span class="badge badge-important">Important</span>
</div>
<div class="cmd-desc"><strong>Kisi specific commit ki details dekho</strong> β kya changes the, message, author sab.</div>
<div class="cmd-when"><span>π Kab use karein:</span> Specific commit mein kya tha ye samajhna ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="comment"># Latest commit dekho</span><br>
<span class="prompt">$</span>git show<br>
<span class="comment"># Specific commit</span><br>
<span class="prompt">$</span>git show a1b2c3d
</div>
</div>
<div class="cmd-card" style="--card-accent: #eab308;" data-tags="blame who changed line author file">
<div class="cmd-top">
<div class="cmd-name">git blame</div>
<span class="badge badge-advanced">Advanced</span>
</div>
<div class="cmd-desc">File ki <strong>har line dekho β kisne kab likhi</strong>. Bug dhundhte waqt ye bahut kaam aata hai π
</div>
<div class="cmd-when"><span>π Kab use karein:</span> Bug kab aur kisne introduce kiya ye pata karna ho</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="prompt">$</span>git blame index.html<br>
<span class="comment"># Specific lines</span><br>
<span class="prompt">$</span>git blame -L 10,20 app.js
</div>
</div>
</div>
</div>
<!-- ===== 8. UNDO ===== -->
<div class="section" id="undo">
<div class="section-header">
<div class="section-icon" style="background:rgba(239,68,68,0.1);">β©οΈ</div>
<div>
<div class="section-title">Undoing Changes</div>
<div class="section-subtitle">Galti ho gayi? Ghabrao mat β Git mein sab undo hota hai</div>
</div>
</div>
<div class="cmd-grid">
<div class="cmd-card" style="--card-accent: #ef4444;" data-tags="reset undo unstage remove commit hard soft">
<div class="cmd-top">
<div class="cmd-name">git reset</div>
<span class="badge badge-important">Important</span>
</div>
<div class="cmd-desc"><strong>Commits wapas lo ya staging clear karo</strong>. 3 modes: soft, mixed (default), hard. Careful with hard!</div>
<div class="cmd-when"><span>π Kab use karein:</span> Local commits undo karne ho (push se pehle)</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">copy</button>
<span class="comment"># Commit undo, files rakho staged</span><br>
<span class="prompt">$</span>git reset --soft HEAD~1<br>
<span class="comment"># Commit undo, files rakho unstaged</span><br>
<span class="prompt">$</span>git reset HEAD~1<br>
<span class="comment"># Sab delete β οΈ careful!</span><br>
<span class="prompt">$</span>git reset --hard HEAD~1
</div>
</div>
<div class="cmd-card" style="--card-accent: #ef4444;" data-tags="revert undo commit safe public">
<div class="cmd-top">
<div class="cmd-name">git revert</div>