-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-guide.html
More file actions
979 lines (855 loc) · 43.5 KB
/
git-guide.html
File metadata and controls
979 lines (855 loc) · 43.5 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
<!DOCTYPE html>
<html lang="he" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>מדריך Git - פקודות שימושיות - CopyCode</title>
<link rel="icon" href="images/logo.png" type="image/png">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
background: url('images/background.jpg') center center / cover no-repeat fixed;
min-height: 100vh;
line-height: 1.6;
color: #2c3e50;
position: relative;
}
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
z-index: 0;
pointer-events: none;
}
.top-header {
position: fixed;
top: 0;
right: 0;
left: 0;
height: 70px;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 2rem;
z-index: 1000;
}
.site-logo {
display: flex;
align-items: center;
gap: 0.75rem;
text-decoration: none;
color: #1a1a1a;
font-size: 1.3rem;
font-weight: 600;
transition: all 0.3s ease;
}
.site-logo:hover {
color: #667eea;
}
.site-logo img {
width: 40px;
height: 40px;
}
.search-btn {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.7rem 1.5rem;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
text-decoration: none;
border-radius: 12px;
font-weight: 600;
transition: all 0.3s ease;
border: none;
cursor: pointer;
}
.search-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
.search-btn svg {
width: 20px;
height: 20px;
}
.layout {
display: flex;
max-width: 1400px;
margin: 0 auto;
min-height: 100vh;
position: relative;
z-index: 1;
padding-top: 90px;
}
.sidebar {
width: 260px;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
padding: 2rem 1rem;
margin-left: 1.5rem;
position: sticky;
top: 110px;
height: calc(100vh - 130px);
overflow-y: auto;
border-left: 1px solid rgba(255, 255, 255, 0.3);
box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
border-radius: 16px;
scrollbar-width: none;
-ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar {
display: none;
}
.sidebar-title {
font-size: 1.1rem;
color: #2c3e50;
margin-bottom: 1.5rem;
font-weight: 600;
padding-bottom: 0.75rem;
border-bottom: 2px solid #3498db;
}
.nav-menu {
list-style: none;
}
.nav-item {
margin-bottom: 0.25rem;
}
.nav-link {
display: block;
padding: 0.6rem 0.8rem;
color: #5a6c7d;
text-decoration: none;
border-radius: 4px;
transition: all 0.2s ease;
font-size: 0.9rem;
font-weight: 500;
}
.nav-link:hover {
background: #ecf0f1;
color: #2c3e50;
padding-right: 1rem;
}
.nav-link.active {
background: #3498db;
color: white;
}
.container {
flex: 1;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
margin: 0 1.5rem 1.5rem 1.5rem;
border-radius: 16px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
border: 1px solid rgba(255, 255, 255, 0.3);
overflow: hidden;
}
header {
background: transparent;
color: #1a1a1a;
padding: 2.5rem 2rem;
text-align: center;
border-bottom: 1px solid #e9ecef;
}
h1 {
font-size: 2.2rem;
margin-bottom: 0.5rem;
font-weight: 600;
letter-spacing: -0.5px;
display: flex;
align-items: center;
justify-content: center;
gap: 1rem;
}
h1 svg {
width: 48px;
height: 48px;
}
.subtitle {
font-size: 1rem;
opacity: 0.85;
font-weight: 400;
}
.content {
padding: 2.5rem;
}
.section {
margin-bottom: 3rem;
}
.section-title {
font-size: 1.6rem;
color: #2c3e50;
margin-bottom: 1.5rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid #3498db;
font-weight: 600;
}
.command-group {
background: #f8f9fa;
border: 1px solid #e1e8ed;
border-radius: 6px;
padding: 1.5rem;
margin-bottom: 1.5rem;
transition: box-shadow 0.2s ease;
}
.command-group:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.command-title {
font-size: 1.1rem;
color: #2c3e50;
margin-bottom: 1rem;
font-weight: 600;
}
.command-wrapper {
position: relative;
margin: 0.8rem 0;
}
.command {
background: #1e1e1e;
color: #4ec9b0;
padding: 0.9rem 3rem 0.9rem 1rem;
border-radius: 4px;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 0.9rem;
direction: ltr;
text-align: left;
border: 1px solid #333;
position: relative;
overflow-x: auto;
white-space: pre-wrap;
line-height: 1.5;
}
.copy-btn {
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
background: transparent;
color: #7f8c8d;
border: 1px solid #bdc3c7;
padding: 0.4rem;
border-radius: 3px;
cursor: pointer;
font-size: 0.75rem;
transition: all 0.2s ease;
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
font-family: monospace;
}
.copy-btn::before {
content: '⧉';
font-size: 1rem;
}
.copy-btn:hover {
background: #ecf0f1;
color: #2c3e50;
border-color: #95a5a6;
}
.copy-btn:active {
transform: translateY(-50%) scale(0.95);
}
.copy-btn.copied {
background: #d5f4e6;
color: #27ae60;
border-color: #27ae60;
}
.copy-btn.copied::before {
content: '✓';
}
.description {
color: #5a6c7d;
margin-bottom: 0.5rem;
margin-top: 1rem;
font-weight: 500;
font-size: 0.95rem;
}
.explanation {
background: #e8f4f8;
border-right: 3px solid #3498db;
padding: 0.75rem;
margin: 0.5rem 0;
border-radius: 4px;
color: #34495e;
font-size: 0.88rem;
line-height: 1.5;
}
.note {
background: #fff3cd;
border-right: 3px solid #f39c12;
padding: 1rem;
border-radius: 4px;
margin: 1rem 0;
}
.note-title {
font-weight: 600;
color: #d68910;
margin-bottom: 0.5rem;
}
footer {
background: #2c3e50;
color: white;
text-align: center;
padding: 1.5rem;
font-size: 0.85rem;
border-top: 3px solid #3498db;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
margin-top: 1rem;
}
@media (max-width: 1024px) {
.layout {
flex-direction: column;
}
.sidebar {
width: 100%;
height: auto;
position: relative;
border-left: none;
border-bottom: 2px solid #3498db;
}
.container {
margin: 0 1rem 1rem 1rem;
}
}
@media (max-width: 768px) {
h1 {
font-size: 1.8rem;
}
.section-title {
font-size: 1.4rem;
}
.command {
font-size: 0.82rem;
padding-left: 0.8rem;
}
.copy-btn {
position: relative;
display: block;
margin-top: 0.5rem;
right: 0;
transform: none;
}
.copy-btn:active {
transform: scale(0.95);
}
.command-wrapper {
display: flex;
flex-direction: column;
}
.content {
padding: 1.5rem;
}
}
.icon {
display: inline-block;
margin-left: 0.5rem;
font-size: 0.9em;
}
.scroll-top {
position: fixed;
bottom: 2rem;
left: 2rem;
background: #3498db;
color: white;
width: 48px;
height: 48px;
border-radius: 4px;
border: none;
cursor: pointer;
font-size: 1.3rem;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
transition: all 0.2s ease;
opacity: 0;
visibility: hidden;
}
.scroll-top.visible {
opacity: 1;
visibility: visible;
}
.scroll-top:hover {
background: #2980b9;
transform: translateY(-3px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
</style>
</head>
<body>
<div class="top-header">
<a href="index.html" class="site-logo">
<img src="images/logo.png" alt="לוגו האתר">
CopyCode
</a>
<a href="search.html" class="search-btn">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21 21L15 15M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span>חיפוש</span>
</a>
</div>
<div class="layout">
<nav class="sidebar">
<div class="sidebar-title">תוכן עניינים</div>
<ul class="nav-menu">
<li class="nav-item"><a href="#basics" class="nav-link">פעולות בסיסיות</a></li>
<li class="nav-item"><a href="#diff" class="nav-link">עבודה עם DIFF</a></li>
<li class="nav-item"><a href="#commits" class="nav-link">עריכת קומיטים</a></li>
<li class="nav-item"><a href="#undo" class="nav-link">ביטולים</a></li>
<li class="nav-item"><a href="#stash" class="nav-link">עבודה עם Stash</a></li>
<li class="nav-item"><a href="#branches" class="nav-link">ענפים ו-PR</a></li>
<li class="nav-item"><a href="#github-cli" class="nav-link">GitHub CLI</a></li>
<li class="nav-item"><a href="#sync" class="nav-link">סנכרון מוחלט</a></li>
<li class="nav-item"><a href="#tools" class="nav-link">כלים נוספים</a></li>
<li class="nav-item"><a href="#custom" class="nav-link">פקודות נוספות</a></li>
</ul>
</nav>
<div class="container">
<header>
<h1>
<svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg">
<path fill="#F05032" d="M251.172 116.594L139.4 4.828c-6.433-6.437-16.873-6.437-23.314 0l-23.21 23.21 29.443 29.443c6.842-2.312 14.688-.761 20.142 4.693 5.48 5.489 7.02 13.402 4.652 20.266l28.375 28.376c6.865-2.365 14.786-.835 20.269 4.657 7.663 7.66 7.663 20.075 0 27.74-7.665 7.666-20.08 7.666-27.749 0-5.764-5.77-7.188-14.235-4.27-21.336l-26.462-26.462-.003 69.637a19.82 19.82 0 0 1 5.188 3.71c7.663 7.66 7.663 20.076 0 27.747-7.665 7.662-20.086 7.662-27.74 0-7.663-7.671-7.663-20.086 0-27.746a19.654 19.654 0 0 1 6.421-4.281V94.196a19.378 19.378 0 0 1-6.421-4.281c-5.806-5.798-7.202-14.317-4.227-21.446L81.47 39.442l-76.64 76.635c-6.44 6.443-6.44 16.884 0 23.322l111.774 111.768c6.435 6.438 16.873 6.438 23.316 0l111.251-111.249c6.438-6.44 6.438-16.887 0-23.324"/>
</svg>
מדריך Git מקיף
</h1>
<p class="subtitle">פקודות שימושיות לעבודה יומיומית</p>
</header>
<div class="content">
<!-- פעולות בסיסיות -->
<div class="section" id="basics">
<h2 class="section-title">פעולות בסיסיות</h2>
<div class="command-group">
<div class="command-title">משיכה ודחיפה</div>
<div class="description">משיכת שינויים מהשרת:</div>
<div class="explanation">מביא את כל השינויים האחרונים מהמאגר המרוחק ומשלב אותם עם הענף המקומי שלך</div>
<div class="command-wrapper">
<div class="command">git pull</div>
<button class="copy-btn" onclick="copyCommand(this, 'git pull')"></button>
</div>
<div class="description">הוספת כל הקבצים לסטייג':</div>
<div class="explanation">מוסיף את כל הקבצים שהשתנו (חדשים, ערוכים או נמחקו) לאזור ההכנה לפני הקומיט</div>
<div class="command-wrapper">
<div class="command">git add .</div>
<button class="copy-btn" onclick="copyCommand(this, 'git add .')"></button>
</div>
<div class="description">יצירת קומיט:</div>
<div class="explanation">שומר את השינויים שבסטייג' כקומיט חדש עם הודעה תיאורית</div>
<div class="command-wrapper">
<div class="command">git commit -m "תיאור כלשהו"</div>
<button class="copy-btn" onclick="copyCommand(this, 'git commit -m \"תיאור כלשהו\"')"></button>
</div>
<div class="description">דחיפה לענף main:</div>
<div class="explanation">שולח את הקומיטים המקומיים שלך לענף main במאגר המרוחק</div>
<div class="command-wrapper">
<div class="command">git push origin main</div>
<button class="copy-btn" onclick="copyCommand(this, 'git push origin main')"></button>
</div>
<div class="description">דחיפה לענף master:</div>
<div class="explanation">שולח את הקומיטים המקומיים שלך לענף master במאגר המרוחק (שם ישן לענף ראשי)</div>
<div class="command-wrapper">
<div class="command">git push origin master</div>
<button class="copy-btn" onclick="copyCommand(this, 'git push origin master')"></button>
</div>
</div>
</div>
<!-- עבודה עם DIFF -->
<div class="section" id="diff">
<h2 class="section-title">עבודה עם DIFF</h2>
<div class="command-group">
<div class="command-title">יצירת קבצי DIFF</div>
<div class="note">
<div class="note-title">⚠️ שים לב!</div>
השינויים שלא בסטייג' - לא מוציא קבצים שהתווספו!!!
</div>
<div class="description">שינויים שלא בסטייג':</div>
<div class="explanation">יוצר קובץ המכיל את כל ההבדלים בין הקבצים הנוכחיים לבין הקומיט האחרון (רק קבצים קיימים, לא חדשים)</div>
<div class="command-wrapper">
<div class="command">git diff > DIFF1.TXT</div>
<button class="copy-btn" onclick="copyCommand(this, 'git diff > DIFF1.TXT')"></button>
</div>
<div class="description">שינויים שבסטייג':</div>
<div class="explanation">יוצר קובץ המכיל את כל השינויים שכבר הוספו לסטייג' (עם git add) ומוכנים לקומיט</div>
<div class="command-wrapper">
<div class="command">git diff --cached > DIFF.TXT</div>
<button class="copy-btn" onclick="copyCommand(this, 'git diff --cached > DIFF.TXT')"></button>
</div>
<div class="description">החלת DIFF:</div>
<div class="explanation">מיישם את השינויים מקובץ DIFF על הקבצים הנוכחיים, תוך תיקון אוטומטי של בעיות רווחים</div>
<div class="command-wrapper">
<div class="command">git apply --whitespace=fix diff-commit.txt</div>
<button class="copy-btn" onclick="copyCommand(this, 'git apply --whitespace=fix diff-commit.txt')"></button>
</div>
<div class="description">יצירת DIFF לקומיט ספציפי:</div>
<div class="explanation">מייצא את כל השינויים שנעשו בקומיט מסוים לקובץ טקסט (החלף XXX במזהה הקומיט המלא)</div>
<div class="command-wrapper">
<div class="command">git show 953e3a5747eXXX > diff-commit.txt</div>
<button class="copy-btn" onclick="copyCommand(this, 'git show 953e3a5747eXXX > diff-commit.txt')"></button>
</div>
</div>
</div>
<!-- עריכת קומיטים -->
<div class="section" id="commits">
<h2 class="section-title">עריכת קומיטים</h2>
<div class="grid">
<div class="command-group">
<div class="command-title">שינוי שם קומיט אחרון</div>
<div class="explanation">משנה את הודעת הקומיט האחרון מבלי לשנות את התוכן שלו</div>
<div class="command-wrapper">
<div class="command">git commit --amend -m "XXXXXXX"</div>
<button class="copy-btn" onclick="copyCommand(this, 'git commit --amend -m \"XXXXXXX\"')"></button>
</div>
</div>
<div class="command-group">
<div class="command-title">הוספת קבצים לקומיט אחרון</div>
<div class="description">הכנסת הקבצים שבסטייג' לקומיט האחרון:</div>
<div class="explanation">מוסיף קבצים נוספים לקומיט האחרון מבלי לשנות את ההודעה שלו</div>
<div class="command-wrapper">
<div class="command">git commit --amend --no-edit</div>
<button class="copy-btn" onclick="copyCommand(this, 'git commit --amend --no-edit')"></button>
</div>
</div>
</div>
<div class="command-group">
<div class="command-title">דחיפה כפויה</div>
<div class="description">אם כבר עודכן בגיטהאב:</div>
<div class="explanation">כופה את הדחיפה גם אם יש קונפליקט עם המאגר המרוחק - משכתב את ההיסטוריה</div>
<div class="command-wrapper">
<div class="command">git push --force</div>
<button class="copy-btn" onclick="copyCommand(this, 'git push --force')"></button>
</div>
<div class="note">
<div class="note-title">⚠️ זהירות!</div>
שימוש ב-force push עלול לדרוס שינויים של אחרים
</div>
</div>
</div>
<!-- ביטולים -->
<div class="section" id="undo">
<h2 class="section-title">ביטולים</h2>
<div class="grid">
<div class="command-group">
<div class="command-title">ביטול קומיט אחרון</div>
<div class="explanation">מבטל את הקומיט האחרון אך שומר את השינויים בסטייג' - מאפשר לערוך ולעשות קומיט מחדש</div>
<div class="command-wrapper">
<div class="command">git reset --soft HEAD~1</div>
<button class="copy-btn" onclick="copyCommand(this, 'git reset --soft HEAD~1')"></button>
</div>
</div>
<div class="command-group">
<div class="command-title">ביטול מיזוג</div>
<div class="explanation">מבטל תהליך מיזוג (merge) שנתקע באמצע בגלל קונפליקטים ומחזיר למצב שלפני המיזוג</div>
<div class="command-wrapper">
<div class="command">git merge --abort</div>
<button class="copy-btn" onclick="copyCommand(this, 'git merge --abort')"></button>
</div>
</div>
</div>
</div>
<!-- Stash -->
<div class="section" id="stash">
<h2 class="section-title">עבודה עם Stash</h2>
<div class="command-group">
<div class="command-title">שמירה והוצאה</div>
<div class="description">הכנסת קבצים לסטאש:</div>
<div class="explanation">שומר את כל השינויים הנוכחיים בצד באופן זמני, מנקה את ספריית העבודה - שימושי כשצריך לעבור לענף אחר</div>
<div class="command-wrapper">
<div class="command">git stash push</div>
<button class="copy-btn" onclick="copyCommand(this, 'git stash push')"></button>
</div>
<div class="description">הכנסת רק הקבצים שבסטייג' לסטאש:</div>
<div class="explanation">שומר רק את הקבצים שכבר הוספת לסטייג' (עם git add), משאיר את השאר בספריית העבודה</div>
<div class="command-wrapper">
<div class="command">git stash push --staged</div>
<button class="copy-btn" onclick="copyCommand(this, 'git stash push --staged')"></button>
</div>
<div class="description">הוצאה מהסטאש:</div>
<div class="explanation">מחזיר את השינויים האחרונים שנשמרו בסטאש לספריית העבודה ומוחק אותם מהסטאש</div>
<div class="command-wrapper">
<div class="command">git stash pop</div>
<button class="copy-btn" onclick="copyCommand(this, 'git stash pop')"></button>
</div>
</div>
</div>
<!-- עבודה עם ענפים -->
<div class="section" id="branches">
<h2 class="section-title">עבודה עם ענפים ו-PR</h2>
<div class="command-group">
<div class="command-title">משיכת Pull Request</div>
<div class="description">משיכת PR:</div>
<div class="explanation">מוריד Pull Request ספציפי מגיטהאב ויוצר ממנו ענף מקומי (החלף 40?? במספר ה-PR ו-branch_name בשם הענף הרצוי)</div>
<div class="command-wrapper">
<div class="command">git fetch origin pull/40??/head:branch_name</div>
<button class="copy-btn" onclick="copyCommand(this, 'git fetch origin pull/40??/head:branch_name')"></button>
</div>
<div class="description">מיזוג:</div>
<div class="explanation">משלב את השינויים מהענף המצוין לתוך הענף הנוכחי שלך</div>
<div class="command-wrapper">
<div class="command">git merge branch_name</div>
<button class="copy-btn" onclick="copyCommand(this, 'git merge branch_name')"></button>
</div>
</div>
<div class="command-group">
<div class="command-title">מחיקת ענפים</div>
<div class="description">מחיקה מקומית:</div>
<div class="explanation">מוחק ענף מקומי בכוח, גם אם יש בו שינויים שלא מוזגו (החלף giXXX בשם הענף)</div>
<div class="command-wrapper">
<div class="command">git branch -D giXXX</div>
<button class="copy-btn" onclick="copyCommand(this, 'git branch -D giXXX')"></button>
</div>
<div class="description">מחיקה בגיטהאב:</div>
<div class="explanation">מוחק ענף מהמאגר המרוחק בגיטהאב (החלף giXXX בשם הענף)</div>
<div class="command-wrapper">
<div class="command">git push origin --delete giXXX</div>
<button class="copy-btn" onclick="copyCommand(this, 'git push origin --delete giXXX')"></button>
</div>
</div>
</div>
<!-- GitHub CLI -->
<div class="section" id="github-cli">
<h2 class="section-title">GitHub CLI - Actions</h2>
<div class="command-group">
<div class="command-title">בדיקת Actions</div>
<div class="description">רשימת ריצות:</div>
<div class="explanation">מציג רשימה של כל הריצות האחרונות של GitHub Actions במאגר הנוכחי</div>
<div class="command-wrapper">
<div class="command">gh run list</div>
<button class="copy-btn" onclick="copyCommand(this, 'gh run list')"></button>
</div>
<div class="description">בדיקת ריצה ספציפית:</div>
<div class="explanation">מציג פרטים מלאים על ריצת Action ספציפית לפי מספר המזהה שלה</div>
<div class="command-wrapper">
<div class="command">gh run view --job=[מספר ID]</div>
<button class="copy-btn" onclick="copyCommand(this, 'gh run view --job=[מספר ID]')"></button>
</div>
<div class="description">בדיקה אוטומטית כל 3 שניות:</div>
<div class="explanation">עוקב אחרי ריצת Action בזמן אמת, מתעדכן אוטומטית כל 3 שניות עד לסיום</div>
<div class="command-wrapper">
<div class="command">gh run watch</div>
<button class="copy-btn" onclick="copyCommand(this, 'gh run watch')"></button>
</div>
<div class="note">
<div class="note-title">💡 טיפ</div>
לאחר הפקודה, הוא מציג את התהליך הרץ - לחץ Enter
</div>
<div class="description">יצירת ריצת Action ידנית:</div>
<div class="explanation">מפעיל ידנית workflow ספציפי על ענף main (החלף ???.yml בשם קובץ ה-workflow)</div>
<div class="command-wrapper">
<div class="command">gh workflow run ???.yml --ref main</div>
<button class="copy-btn" onclick="copyCommand(this, 'gh workflow run ???.yml --ref main')"></button>
</div>
</div>
</div>
<!-- סנכרון -->
<div class="section" id="sync">
<h2 class="section-title">סנכרון מוחלט</h2>
<div class="command-group">
<div class="command-title">איפוס מלא לגיטהאב</div>
<div class="description">השוואת המאגר המקומי לגיטהאב באופן מוחלט:</div>
<div class="explanation">מאפס את כל הקבצים למצב המדויק של ענף main בגיטהאב - מוחק את כל השינויים המקומיים</div>
<div class="command-wrapper">
<div class="command">git reset --hard origin/main</div>
<button class="copy-btn" onclick="copyCommand(this, 'git reset --hard origin/main')"></button>
</div>
<div class="explanation">מוחק את כל הקבצים והתיקיות שלא במעקב Git (untracked files)</div>
<div class="command-wrapper">
<div class="command">git clean -fd</div>
<button class="copy-btn" onclick="copyCommand(this, 'git clean -fd')"></button>
</div>
<div class="note">
<div class="note-title">⚠️ אזהרה!</div>
פעולה זו תמחק את כל השינויים המקומיים שלא נשמרו!
</div>
</div>
</div>
<!-- כלים נוספים -->
<div class="section" id="tools">
<h2 class="section-title">כלים נוספים</h2>
<div class="grid">
<div class="command-group">
<div class="command-title">Repomix</div>
<div class="explanation">כלי לאריזת המאגר לקובץ אחד תוך התעלמות מקבצים מסוימים - שימושי לשיתוף עם AI</div>
<div class="command-wrapper">
<div class="command">repomix --ignore "assets/otzar_books.csv,assets/hebrew_books.csv,assets/metadata.json,installer/otzaria_full.iss,assets/ca/netfree_cas.pem,sivan22.pfx"</div>
<button class="copy-btn" onclick="copyCommand(this, 'repomix --ignore \"assets/otzar_books.csv,assets/hebrew_books.csv,assets/metadata.json,installer/otzaria_full.iss,assets/ca/netfree_cas.pem,sivan22.pfx\"')"></button>
</div>
</div>
<div class="command-group">
<div class="command-title">VS Code</div>
<div class="description">פתיחה בטאב חדש:</div>
<div class="explanation">פותח את הקובץ הנוכחי בטאב חדש ב-VS Code</div>
<div class="command-wrapper">
<div class="command">Ctrl+Shift+P → "line: Open In New Tab"</div>
<button class="copy-btn" onclick="copyCommand(this, 'Ctrl+Shift+P')"></button>
</div>
</div>
</div>
</div>
<!-- פקודות נוספות -->
<div class="section" id="custom">
<h2 class="section-title">פקודות נוספות</h2>
<div class="command-group">
<div class="command-title">הוסף פקודות משלך</div>
<div class="explanation">כאן תוכל להוסיף פקודות נוספות שאתה משתמש בהן לעיתים קרובות</div>
<div id="custom-commands-container">
<!-- פקודות מותאמות אישית יופיעו כאן -->
</div>
<div style="margin-top: 1.5rem; padding: 1rem; background: #e8f4f8; border-radius: 4px; border-right: 3px solid #3498db;">
<div style="font-weight: 600; margin-bottom: 0.75rem; color: #2c3e50;">הוסף פקודה חדשה:</div>
<input type="text" id="new-command-title" placeholder="כותרת הפקודה"
style="width: 100%; padding: 0.5rem; margin-bottom: 0.5rem; border: 1px solid #bdc3c7; border-radius: 3px; font-family: inherit;">
<input type="text" id="new-command-text" placeholder="הפקודה עצמה"
style="width: 100%; padding: 0.5rem; margin-bottom: 0.5rem; border: 1px solid #bdc3c7; border-radius: 3px; font-family: 'Consolas', monospace;">
<textarea id="new-command-explanation" placeholder="הסבר על הפקודה (אופציונלי)"
style="width: 100%; padding: 0.5rem; margin-bottom: 0.5rem; border: 1px solid #bdc3c7; border-radius: 3px; font-family: inherit; resize: vertical; min-height: 60px;"></textarea>
<button onclick="addCustomCommand()"
style="background: #3498db; color: white; border: none; padding: 0.6rem 1.2rem; border-radius: 3px; cursor: pointer; font-weight: 500; transition: background 0.2s;">
הוסף פקודה
</button>
</div>
</div>
</div>
</div>
<footer>
<p>מדריך Git מקיף לעבודה יומיומית</p>
<p style="margin-top: 0.5rem; opacity: 0.7;">© 2025</p>
</footer>
</div>
</div>
<button class="scroll-top" onclick="scrollToTop()">↑</button>
<script>
// פונקציה להעתקת פקודה
function copyCommand(button, command) {
// הסרת התו $ מההתחלה אם קיים
const cleanCommand = command.replace(/^\$ /, '');
navigator.clipboard.writeText(cleanCommand).then(() => {
button.classList.add('copied');
setTimeout(() => {
button.classList.remove('copied');
}, 2000);
}).catch(err => {
console.error('שגיאה בהעתקה:', err);
alert('לא ניתן להעתיק. נסה שוב.');
});
}
// סימון קישור פעיל בניווט
const sections = document.querySelectorAll('.section');
const navLinks = document.querySelectorAll('.nav-link');
window.addEventListener('scroll', () => {
let current = '';
sections.forEach(section => {
const sectionTop = section.offsetTop;
const sectionHeight = section.clientHeight;
if (window.pageYOffset >= sectionTop - 200) {
current = section.getAttribute('id');
}
});
navLinks.forEach(link => {
link.classList.remove('active');
if (link.getAttribute('href') === `#${current}`) {
link.classList.add('active');
}
});
// הצגת כפתור גלילה למעלה
const scrollTopBtn = document.querySelector('.scroll-top');
if (window.pageYOffset > 300) {
scrollTopBtn.classList.add('visible');
} else {
scrollTopBtn.classList.remove('visible');
}
});
// גלילה חלקה לסעיפים
document.querySelectorAll('.nav-link').forEach(link => {
link.addEventListener('click', (e) => {
e.preventDefault();
const targetId = link.getAttribute('href');
const targetSection = document.querySelector(targetId);
if (targetSection) {
targetSection.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
// גלילה למעלה
function scrollToTop() {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
}
// טעינת פקודות מותאמות אישית מ-localStorage
function loadCustomCommands() {
const commands = JSON.parse(localStorage.getItem('customCommands') || '[]');
const container = document.getElementById('custom-commands-container');
if (commands.length === 0) {
container.innerHTML = '<div style="color: #7f8c8d; font-style: italic; padding: 1rem;">עדיין לא הוספת פקודות מותאמות אישית</div>';
return;
}
container.innerHTML = commands.map((cmd, index) => `
<div style="margin-bottom: 1rem; padding: 1rem; background: white; border: 1px solid #e1e8ed; border-radius: 4px;">
<div style="display: flex; justify-content: space-between; align-items: start; margin-bottom: 0.5rem;">
<div class="description" style="margin: 0;">${cmd.title}</div>
<button onclick="deleteCustomCommand(${index})"
style="background: #e74c3c; color: white; border: none; padding: 0.3rem 0.6rem; border-radius: 3px; cursor: pointer; font-size: 0.8rem;">
מחק
</button>
</div>
${cmd.explanation ? `<div class="explanation">${cmd.explanation}</div>` : ''}
<div class="command-wrapper">
<div class="command">${cmd.command}</div>
<button class="copy-btn" onclick="copyCommand(this, '${cmd.command.replace(/'/g, "\\'")}')"></button>
</div>
</div>
`).join('');
}
// הוספת פקודה מותאמת אישית
function addCustomCommand() {
const title = document.getElementById('new-command-title').value.trim();
const command = document.getElementById('new-command-text').value.trim();
const explanation = document.getElementById('new-command-explanation').value.trim();
if (!title || !command) {
alert('נא למלא לפחות כותרת ופקודה');
return;
}
const commands = JSON.parse(localStorage.getItem('customCommands') || '[]');
commands.push({ title, command, explanation });
localStorage.setItem('customCommands', JSON.stringify(commands));
// ניקוי השדות
document.getElementById('new-command-title').value = '';
document.getElementById('new-command-text').value = '';
document.getElementById('new-command-explanation').value = '';
loadCustomCommands();
}
// מחיקת פקודה מותאמת אישית
function deleteCustomCommand(index) {
if (!confirm('האם אתה בטוח שברצונך למחוק פקודה זו?')) {
return;
}
const commands = JSON.parse(localStorage.getItem('customCommands') || '[]');
commands.splice(index, 1);
localStorage.setItem('customCommands', JSON.stringify(commands));
loadCustomCommands();
}
// טעינת פקודות בעת טעינת הדף
window.addEventListener('load', loadCustomCommands);
</script>
</body>
</html>