いつやるの?git入門
DESCRIPTION
↓のv1.1.0版の方が、より見やすく改善したものになってます! http://www.slideshare.net/matsukaz/git-28304397 社内で開催したGit勉強会の資料。 SVNとの比較や、Gitの内部構造と各コマンドの関係、ブランチやリモートリポジトリとの関係を分かりやすく説明したつもり。 こういう資料に対する投げ銭的なのがどうなるのか気になっていたので、もしよろしければ・・・!15円からできるソーシャルカンパサービスだそうですm(_ _)m http://kampa.me/t/devTRANSCRIPT
Rj}�rƖ
&/@������� ��;/BAC9/H
Õƅ
�;/BAC9/H
ĵ»�Ɖñ
��£¹�¹��·�
�·�¡��3D%(.
���¥
ÁĦr�¹³
6BB>���EEE4:719@1=;�>6=B=A�4:/D78CA������ �����
rÃŚy�Ŋů
fgr�ª· řÂa|oR~��
6BB>���EEE4:719@1=;�>6=B=A�/A16C:BH�������� ���
ÃŚy�ő�cpËikR�mL
m�l{oR\m}�V`h|S
V{Ɩ
¼Ā�ĖaoW�ËRfZoR~qƖ
6BB>���EEE4:719@1=;�>6=B=A�B84:3F�����������
ÃŚyWÜV�tn�o�¹³{ËR\od�
6BB>���EEE4:719@1=;�>6=B=A�>3<<C8/������ �����
ÃŚyV�`iV�mŊů`~S��
J�mRik{ÕƅorlLŁƀYoRŕĊl6BB>���EEE4:719@1=;�>6=B=A�2/<73:G5=������������
�53<2/
"7BrÙƃķż
¦±·�
²®¹�²©��²
"7BikUR`RrƖ
"7BrÙƃķż
¦±·�
²®¹�²©��²
"7BikUR`RrƖ
�53<2/
"7B�ºŰlŰSmL
Üġõ£¹�°·ŖŊ���¬
6BB>���EEE5==5:31=;�/0=CB�2/B/13<B3@A�5/::3@G���B316� �
Üġõa|oR£¹�°·ŖŊ���¬mRTt¸¸¸
6BB>���1;>7:/B=0:=5A>=B8>���������AC0D3@A7=<23A9B=>E/::>/>3@6B;:
+C0D3@A7=<rÖÈó
1=;;7B
C>2/B3
¥��³īĤ
µ¹�³��´��²
µ¹�³��´��²
�;3@53�
²©��²
1=;;7B��²©��²ëĨ
C>2/B3��µ¹�³īĤ
U{p1=;;7B�pľä
+C0D3@A7=<ròƑń
úī¥��³sÖk1=;;7Bąŵpoik`xS
JŸűƔ�� �������ƕĞĂ¥��³ryr1=;;7B{lXxbqLþŒ`x`fM
1=;;7B`f�ì�ŀdoR
RZjVrĠÊs�·±�·đƍ
�1=;;7B��C>2/B3��:=5�
²©��²WŢüéb�
"7BrÖÈó
>CA643B16
1=;;7B¥��³īĤ
�;3@53�=@@30/A3�
µ¹�³²©��²
²®¹�²©��²
µ¹�³��´��²
µ¹�³��´��²
µ¹�³²©��²
>CA643B16
1=;;7B¥��³īĤ
�;3@53�=@@30/A3�
µ¹�³²©��²
²®¹�²©��²
µ¹�³��´��²
µ¹�³��´��²
µ¹�³²©��²
43B16m;3@53Wà
1=;;7Bm>CA6Wà
1=;;7B��µ¹�³
²©��²ëĨ
>CA6��²®¹�
²©��²ëĨ
43B16��²®¹�
²©��²V�īĤ�ìĎ
;3@53�@30/A3��²®¹�
²©��²rīĤ�µ¹�³pëĨ
U{p;3@53�@30/A3
pľä
"7Br²��
�«��ąŵ�ŤōpƂv�
�«��ÙĄ�ČV�ÐĻíţ
wm�nrĠÊWµ¹�³lāś
�>CA6�43B16Æû�
¦±·�}��ĠÊWƒŻ
æňŐp²©��²Ùr�¹��Îĝ
ŬsčĴr£¹�°·ŖŊ���¬
~�{
ŖŊąŵpî�dkĸNo¶¹�¥µ¹láŌ^�kR�
ÅŧŐoÌ
¾ýƊĹõ
+C0D3@A7=<pŷR
23D3:=>3@
Øį²©��²
23D3:=>3@ 23D3:=>3@
Øį²©��²mĉpïİ
Ŝ¹�¯¹õ
>C::�@3?C3AB
23D3:=>3@>@7D/B3
�·²©��²
23D3:=>3@>C0:71
7<B35@/B7=<;/</53@
23D3:=>3@>@7D/B3
23D3:=>3@>C0:71
úī
úī�×ƆƓëĨÍƐ
úī�ª¹�
úī�ëĨ
ŇŨŠmťƏõ
%7<CFonćü§µ����
�·²©��²ŇŨŠ
23D3:=>3@>C0:71
23D3:=>3@>C0:71
ťƏ
23D3:=>3@>C0:71
ťƏ
ťƏÜ�ª¹�
23D3:=>3@Ü�ª¹�
úī�ëĨ
úī
"7BríţĔsK��6BB>���EEE4:719@1=;�>6=B=A�::/;<C2A����� �� ��
¦±·�¸��rſŌ³¹³{R�R�
"7B#C0�!:=E57B4:=E
6BB>A���57B6C01=;�2/@/A67�6=@3A/A3
�53<2/
"7BrÙƃķż
¦±·�
²®¹�²©��²
"7BikUR`RrƖ
"7BlüÀo�¹�Ǝös�j
¶¹��²¹�ÊĶ��´��²�
"7B²©��²��¹�·�¸�²���·�����
\r�j�ŊůÛĴ�t
"7BsēZoR��
6BB>���EEE4:719@1=;�>6=B=A�;G93������������
{SºĊ"7BrÖÈó
>CA643B16
1=;;7B¥��³īĤ
�;3@53�=@@30/A3�
µ¹�³²©��²
²®¹�²©��²
µ¹�³��´��²
µ¹�³��´��²
µ¹�³²©��²
>CA643B16
1=;;7B¥��³īĤ
�;3@53�=@@30/A3�
µ¹�³²©��²
²®¹�²©��²
µ¹�³��´��²
µ¹�³��´��²
µ¹�³²©��²
µ¹�³ŋù µ¹�³ŋù
µ¹�³ŋùrÙƃķż
ŅŊķż
57B@==B
>/@3<B167:2BFB
63::=BFB
J�ŅŊķżsêşŕĊl
ŴŊķż
57B
ŅŊķż
57B@==B
>/@3<B167:2BFB
63::=BFB
J�ŅŊķżsêşŕĊl
ŴŊķż
57B
"7B²©��²
¶¹��²¹�ÊĶ��´��²�
ŅŊķż
57B@==B
>/@3<B167:2BFB
63::=BFB
J�ŅŊķżsêşŕĊl
ŴŊķż
57B
"7BWŖŊ`kR���´��² "7B²©��²
¶¹��²¹�ÊĶ��´��²�
ăƈpÊĶ¾r��´��²
ŅŊķż
57B@==B
>/@3<B167:2BFB
63::=BFB
J�ŅŊķżsêşŕĊl
I
57B
=0831BA1=<475
ŴŊķż
"7B²©��²
¶¹��²¹�ÊĶ��´��²�
7<23F
ŅŊķż
57B@==B
>/@3<B167:2BFB
63::=BFB
J�ŅŊķżsêşŕĊl
I
57B
=0831BA
7<23F1=<475
ŴŊķż
"7B²©��²
¶¹��²¹�ÊĶ��´��²�
��¹�·�¸�²���·�����
ŅŊķż
57B@==B
>/@3<B167:2BFB
63::=BFB
J�ŅŊķżsêşŕĊl
I
57B
=0831BA
7<23F1=<475
ŴŊķż
"7B²©��²
¶¹��²¹�ÊĶ��´��²�
��¹�·�¸�²���·�����
�jr�¹�Ǝölķę^�
kR�
"7B�ª· ��¹�Ǝö�ĠÊb�
÷IJmo�"7B�ª·
��¹�ƎörèX
6BB>���EEE4:719@1=;�>6=B=A�>2AB/6:����� ������
¶¹��²¹
Þİņėrµ¹�³ŋù
¶¹��²¹
Þİņėrµ¹�³ŋù
file2
file1 dir1
file3
Ĥ`R¥��³�Êę
"7BŖŊ�Ɔÿb�
git init
¶¹��²¹
file2
file1 dir1
file3
git init
¶¹��²¹ ��¹�·��²� "7B²©��²
git init
ƎöŃÒ ƎöŃÒ
file2
file1 dir1
file3
²©��²pŸå`fRąŵ�
ĞĂb�
git add <filepattern>...
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
file1 dir1
file3
git add file1 dir1/file2
file2
file1
file2
file1 dir1
file3
¶¹��²¹ ��¹�·��²� "7B²©��²
git add file1 dir1/file2
��¹�^��
��¹�^��
dir1
��´��²sŇŤr�²¹
ķż
īĤÙĄ�²©��²pŏƄb�
git commit -m <msg>
file2
file1
file2
file1 dir1
file3
¶¹��²¹ ��¹�·��²� "7B²©��²
git commit -m ‘コミットするよ。’
dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
git commit -m ‘コミットするよ。’
file2
1a401e
file1
file2
file1
file2
file1 dir1
file3
īĤÙĄ�ŏƄ �«�
�$��ŎŦ
dir1 dir1
¥��³�ÐĻ`føî{
57B�/22
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
file2
file1
file2
file1’ dir1
file3
¥��³�ÐĻ
dir1 dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
file2
file1
file2
file1’ dir1
file3
git add .
dir1 dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
file2
file1’
file2
file1’ dir1
file3
git add .
file3
OPsÖkrıŏƄ¥��³W��¹�^��
dir1 dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
file2
file1’
file2
file1’ dir1
file3 file3
git commit -m ‘もっとコミット。’
dir1 dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8
file3
file1’
file2
file1’
file3file2
file1’ dir1
file3
git commit -m ‘もっとコミット。’
dir1 dir1
īĤÙĄ�ŏƄ
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8
file3
file1’
file2
file1’
file3file2
file1’ dir1
file3
git commit -m ‘もっとコミット。’
ãr1=;;7BWŮmo�
dir1 dir1
¥��³�âƇb�
git rm <file>...
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8
file3
file1’
file2
file1’
file3file2
file1’ dir1
file3
git rm dir1/file2
dir1 dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8
file3
file1’file1’
file3
file1’ dir1
file3
git rm dir1/file2
dir1 dir1
¥��³WâƇ^��
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8
file3
file1’file1’
file3
file1’ dir1
file3
git commit -m ‘削除情報をコミット。’
dir1 dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8 6ccfda
file3
file1’file1’
file3
file1’ dir1
file3
git commit -m ‘削除情報をコミット。’
īĤÙĄ�ŏƄ
dir1 dir1
��¹�·��²��"7B²©��²r
ņėpĚb
git reset HEAD <file>
J�# ���"7B²©��²WŭkR�ĮĤr1=;;7BÇŞ
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8 6ccfda
file3
file1’file1’
file3’
file1’ dir1
file3’
dir1 dir1��¹�^�k�
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8 6ccfda
file3
file1’file1’
file3’
file1’ dir1
file3’
git reset HEAD dir1/file3
dir1 dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8 6ccfda
file3
file1’file1’
file3
file1’ dir1
file3’
git reset HEAD dir1/file3
dir1 dir1
��¹�`koRņėpĚ^
��
¶¹��²¹���¹�·��²�rņėpĚb
git checkout -- <file>
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8 6ccfda
file3
file1’file1’
file3
file1’ dir1
file3’
¥��³�ÐĻ
dir1 dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8 6ccfda
file3
file1’file1’
file3
file1’ dir1
file3’
git checkout -- dir1/file3
dir1 dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8 6ccfda
file3
file1’file1’
file3
file1’ dir1
file3
git checkout -- dir1/file3
ÐĻ`f¥��³WĚ^
��
dir1 dir1
\\xlrĿ��ĢŊb�m
"7B²©��²¶¹��²¹ ��¹�·��²�
57B�@3A3B�# ����47:3�
57B�/22�@;�;D
57B�16319=CB���47:3�
57B�1=;;7B
57B�7<7B
¥��³īĤ
¥��³r±�¥���³l
ĢŊb�m
C<B@/1932�ıŸŶ�
C<;=274732�ıīĤ�
;=274732�īĤQ��
AB/532���¹��
57B�/22
57B�@;
ÐĻ
57B�/22
1=;;7B
57B�@;
"7B²©��²ıŏƄ¥��³ry
erÄr÷IJ�ª·
¥��³}��´��²�
Ŕèb�
git mv
�¹�Ǝö�ĞĂ1=;;7BrņėpĚb
git reset --<mode> <commit>
57B�@3A3Br�§�°·onsÆ»rųħWÜV�}bRrlŲŘseh�l6BB>���26/B3</<38>�;C@/<9��� ����� �� ������
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8 6ccfda
file3
file1’file1’
file3
file1’ dir1
file3
git reset --hard HEAD^
dir1 dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8 6ccfda
file3
file1’file1’
file3
file1’ dir1
file3
git reset --hard HEAD^
file2file2
# ��rºjãr1=;;7BrņėpĚ�
dir1 dir1
¶¹��²¹rņė�ŭ�
git status
�«��µ��ŭ�
git log
�53<2/
"7BrÙƃķż
¦±·�
²®¹�²©��²
"7BikUR`RrƖ
¦±·�ms
�·msàrĿ�l
ÊĶ�ŝ[�ĺţ
+C0D3@A7=<røî
�B@C<9
� �
��
�
�
��
B@C<9uª¹�
'�
B@C<9 ��� ��B@C<9 0@/<16 B/5
"7BpsB@C<9WoR
ÖkW¦±·�
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8 6ccfda
file3
file1’file1’
file3
file1’ dir1
file3
dir1 dir1
¶¹��²¹ ��¹�·��²� "7B²©��²
file2
1a401e
file1
510db8 6ccfda
file3
file1’file1’
file3
file1’ dir1
file3
dir1 dir1
;/AB3@
"7BŖŊ�Ɔÿb�m;/AB3@¦±·�W�¥�³�lŌĕ^��
�«���±¥lŧʼnb�m
A B
;/AB3@
A B
;/AB3@
¦±·�s1=;;7BrÇŞ�
Ğbg[
1=;;7Bb�m;/AB3@rÇŞ
{Ŕèb�;/AB3@
A B C
23D3:=>¦±·��Ýiføî{Lïa1=;;7B�Ğb
;/AB3@
A B C
23D3:=>
;/AB3@
A B C D
;/AB3@l1=;;7Bb�m;/AB3@g[Ŕè
b�
23D3:=>
;/AB3@
A B C D
E
23D3:=>
23D3:=>{;/AB3@msàl
Ŕèb�
;/AB3@
A B C D
E
;3@53b�øî
23D3:=>
;/AB3@
A B C D
E
;3@53b�øî
;/AB3@l23D3:=>�
;3@53
23D3:=>
;3@53b�øî
;/AB3@
A B C D
E
F
�m r½ĥr1=;;7BWŮm
o�
1=<4:71Bb�øîs
ąĒ
23D3:=>
;/AB3@
A B C D
E
F
erČ{Ñàp1=;;7BlX�
G
H
;3@53b�øî
23D3:=>
;/AB3@
A B C D
E
@30/A3b�øî
23D3:=>l;/AB3@�@30/A3 23D3:=>
;/AB3@
A B C D
@30/A3b�øî
E23D3:=>m
;/AB3@rØźÔœpŔèLe\V� r
2744�ìĎ
23D3:=>
;/AB3@
A B C D
E’
@30/A3b�øî
E
ìĎ`f2744�;/AB3@pƁŌ`kĤfo1=;;7B�Êę
23D3:=>
;/AB3@
A B C D
E’
@30/A3b�øî
1=<4:71Bb�øîs
ąĒ23D3:=>
A B C D
E’
@30/A3b�øî
;/AB3@
F
G
erČ{Ñàp1=;;7BlX�
23D3:=>
;3@53=@
@30/A3��
R�R�Ŵ¿WQ�rlƁijƁěl
6BB>���EEE4:719@1=;�>6=B=A�0/AB7//<AA3<������ ���
¦±·�ĠÊr�ª·
Ɠ�¹�ƎörèX
6BB>���EEE4:719@1=;�>6=B=A�AB/B9@/4B������ �����
¶¹��²¹ ��¹�·��²� "7B²©��²
A
file1
;/AB3@
# ��
B
file1’file1’file1’
Ć`1=;;7B`fµ¹�³ŋù
¶¹��²¹ ��¹�·��²� "7B²©��²
A
file1
;/AB3@
# ��
B
file1’file1’file1’
Ć`1=;;7B`fµ¹�³ŋù
ʼnôÊĶ¾r¦±·��ŧb
# ��mrĈÜlīĤ�ßģ
"7Br¦±·��Êęb�
git branch [<old>] <new>
¶¹��²¹ ��¹�·��²� "7B²©��²
git branch develop
A
file1
;/AB3@
# ��
B
file1’file1’file1’
¶¹��²¹ ��¹�·��²� "7B²©��²
git branch develop
A
file1
;/AB3@
# ��
B 23D3:=>
file1’file1’file1’
23D3:=>¦±·�WÛĴ�# ��r
ÇŞsú��oR
ÊĶ¾r¦±·��Ý�ĭT�
git checkout <branch>
¶¹��²¹ ��¹�·��²� "7B²©��²
git checkout develop
A
file1
;/AB3@
# ��
B
23D3:=>
file2
file1’
C
file1’file1’
¶¹��²¹ ��¹�·��²� "7B²©��²
git checkout develop
A
file1
;/AB3@
# ��B
23D3:=>
file2
file1’
C
# ��rÇŞWú��
file2file2
# ��pî�dkďÓ
file1 file1
git checkout -b <new> <old>
"7Br¦±·��Êę`kÝ�ĭT�
git checkout -b <new> <old>
git checkout <new>
git branch [<old>] <new>
�
git merge <branch>
ʼnôr¦±·�pĞæ±·��ª¹�b�
¶¹��²¹ ��¹�·��²� "7B²©��²
git merge develop
file1’file1’
A
file1
;/AB3@
# ��
B
23D3:=>
file2
file1’
C
¶¹��²¹ ��¹�·��²� "7B²©��²
git merge develop
file2
file1’file2
file1’
;3@53�1=;;7BW���
A
file1
;/AB3@
# ��
B
23D3:=>
file2
file1’
D
C
�rúī{ëĨ^��
git rebase <branch>
ʼnôr¦±·��Ğæ±·�V�²¨¹�b�
¶¹��²¹ ��¹�·��²� "7B²©��²
A
git rebase master
file1
file2file2
file1file1
;/AB3@ # ��
B 23D3:=>
C
file2
file1’
¶¹��²¹ ��¹�·��²� "7B²©��²
A
;/AB3@ # ��
git rebase master
B 23D3:=>
C’
file2
file1
file1’
file2file2
file1’file1’
;/AB3@rĮĤ1=;;7Bp@30/A3^��
�rúī{ëĨ^��
�53<2/
"7BrÙƃķż
¦±·�
²®¹�²©��²
"7BikUR`RrƖ
²®¹�²©��²ms¦±·�lŽğ
�«���±¥lŧʼnb�m
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
A B1:=<3lµ¹�
³p²©��²W�¤¹^��
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
A B
²®¹�¦±·��²®¹�rņė�Ğb�
ïðrµ¹�³¦±·�
{ÛĴ�
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
A B
²®¹�²©��²�¦±·�ð
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C
A B
²®¹�WÔpž�g
øîs
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C
A B C43B16b�m
²®¹�¦±·�{ïaņėp
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C
A B Cµ¹�³¦±·�
s²®¹�¦±·�m;3@53�@30/A3
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C
A B>C::�
43B16�;3@53�@30/A3orl
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C
A B C>C::o�µ¹�³
¦±·�{²®¹�¦±·�{ïĩpīĤ
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C
A B C D
1=;;7B`føîs
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C D
A B C D
²®¹�¦±·�m²®¹�²©��²pëĨ
>CA6��
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C D F
A B C D E
½ĥīĤ^�føîs
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C D F
A B C D E G
F
ºĊ;3@53`k
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C D F
>CA6��
G
A B C D E G
F
E
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C D F
A B C D E
ÄrĥĽm`ks
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C D F
A B C D F
E@30/A3{�²
E’
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B
=@757<�;/AB3@
;/AB3@
C D F
>CA6��
E’
A B C D F E’
µ¹�³²©��²
²®¹�²©��²
;/AB3@
A B C E F
D G H
23D3:=>
;/AB3@
A B C E F I
D G
23D3:=>
=@757<�;/AB3@
=@757<�23D3:=>
g�g�ūƋpo�
²®¹�ĠÊr�ª·
Ɠ�¹�ƎörèX
6BB>���EEE4:719@1=;�>6=B=A�:==H@0=G��� �� ����
²®¹�²©��²�µ¹�³pūŪ
git clone <url>
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file1’file1’
A B
;/AB3@
file1
file1’
;/AB3@
A B
# ��
=@757<�;/AB3@
�¹�ƎöWÊ���
git clone [email protected]:a/b.git
¥��³{ďÓ^��
²®¹�²©��²púī�ŹÏ
git push <remote> <refspec>
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file1’file1’
A B
;/AB3@
file1
file1’
;/AB3@
A B
# ��
=@757<�;/AB3@
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file1’file1’
A B
;/AB3@
file2
file1
file1’
;/AB3@
A B
# ��
=@757<�;/AB3@¥��³Êę
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file1’file1’
A B
;/AB3@
file2 file2
file1
file1’
;/AB3@
A B
# ��
=@757<�;/AB3@57B�/22
git add file2
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file1’file1’
A B
;/AB3@
file2 file2
file1
file1’
;/AB3@
A B
# ��
=@757<�;/AB3@
C
file2
57B�1=;;7B
git commit -m ‘add file2’
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file1’file1’
A B C
;/AB3@
file1
file1’
;/AB3@
A B
# ��
=@757<�;/AB3@
C
file2
²®¹�²©��²ëĨ
file2 file2
git push origin master
²®¹�¦±·��ĮĤpīĤ
git fetch <remote> <refspec>
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file1’file1’
A B C
git fetch origin master
;/AB3@
file1
file1’
;/AB3@
A B
# ��
=@757<�;/AB3@
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file1’file1’
A B C
git fetch origin master
;/AB3@
file1
file1’
;/AB3@
A B
# ��
=@757<�;/AB3@
C
file2
²®¹�¦±·�īĤ
git pull <remote> <refspec>
git merge <branch>
git fetch <remote> <refspec>
�
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file2file2
A B C
git pull origin master
;/AB3@
file1
file1’
;/AB3@A B
# ��
=@757<�;/AB3@
Dfile2
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file1
file1’
;/AB3@
A B
# ��
=@757<�;/AB3@
C
D
E
A B C
;/AB3@
git pull origin master
file2
file3file3file3
file2file2
²®¹�¦±·�īĤ
;3@53
git pull <remote> <refspec> --rebase
git rebase <branch>
git fetch <remote> <refspec>
�
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file2file2
A B C
git pull origin master --rebase
;/AB3@
file1
file1’
;/AB3@A B
# ��
=@757<�;/AB3@
Dfile2
¶¹��²¹ ��¹�·��²�
µ¹�³²©��²
²®¹�²©��²
file2file2
A B C
git pull origin master --rebase
;/AB3@
file1
file1’
;/AB3@A B
# ��
=@757<�;/AB3@
D’file2
C
file3file3file3
²®¹�¦±·�īĤ
@30/A3
xmz
ŘVR�ª· sxgxgQ�rl
��ikq
xcsµ¹�³lr
ĠÊpĘ�~S��
²®¹�mr}�m�s
>CA6m>C::�ËSテキスト
43B16}Ñàr;3@53�@30/A3s
�kV�
ĪļV�²®¹�mr�´�ĜT�~SpĐW[�
UV`Zoif��¹�Ǝör
ņė�Úƌpŭ�
üÀors�¹�Ǝö��
\�l"7B{Éũgq��
êş-*%�Ĭŗ �³l{�V�"7BÕƅ
6BB>���EEE0/19:=58>�57B5C723�
)@=�"7B
6BB>���57BA1;1=;�0==9�8/�
57B�@3A3BpjRkrÜV�}bRųħ
6BB>���26/B3</<38>�;C@/<9��� ����� �� ������
;3@53�@30/A3pjRkrÜV�}bRųħ
6BB>���EEEA:723A6/@3<3B�9=B/A�57B ���� �
%3/@<�"7B��@/<167<5��¦±·�ĠÊrçċ����
6BB>���9AE211�:3/@<"7B�@/<167<58/�
�¹³ř +=C@13,@33
6BB>���EEEA=C@13B@33/>>1=;�
"7B#C0�4=@�&/1
6BB>���;/157B6C01=;�
]łšQ�WmS]_Rx`f