a# Git-Tutorials ?箸雿輻?飛 📝
?撠?閬箏??镼輯?閎???�隞亙停蝪∪撖怠�?摮豢?嚗?靘輯???銝?memo:嚗??撟怠?喳飛?犖:smile:
憒??飛?炊??蝟暹迤:sweat_smile:
?箸雿輻?誘隞亙?摰??臬???撘????蔣??
敶梁??飛?憒??Y? SSH key
憒?甇仿?甇?Ⅱ銝??粹隤歹??臭誑?刻楝敺??曉 **.ssh鞈?憭?*嚗ㄐ?X? id_rsa 隞亙? id_rsa.pub ?拙�?獢?
??停??SSH Key嚗?*id_rsa?舐??? 嚗??賣援?脣?鳴? *id_rsa.pub?臬?? 嚗隞亙??曉???閮港遙雿犖??
摰?摰?Git 銋?嚗???蝚砌?隞嗡??停?臬閮剖??芸楛??摮?靽∠拳
git config --global user.name "twtrubiks"
git config --global user.email "[email protected]"
?臭誑頛詨隞乩?靘Ⅱ隤?西撓?交???
git config --global user.name
git config --global user.email
Git 閮剖?鞈??亦?嚗?瑁?隞乩??誘 ( ???急???閰喟敦??摮?)嚗?
git config --list
????git
git init
銋隞交?摰??冗
git init <directory>
銴ˊ憒?雿蔭蝬脣? ( 銝?銴ˊ???年 銴ˊ雿撌梁? )
git clone ( 銴ˊ?雯?� ) SSH / HTTPS
( 憒?雿?雿輻 https ?撘? 隢?? Personal Access Tokens )
git clone git@github.com:twtrubiks/test.git
蝚砌?甈⊥??箇 SSH 霅血?嚗 YES ?喳??
憒? ( 銝??? )嚗雿?銝?頝臬?銝停???箔????冗
敺?2021/8/13 ??, 憒?雿 https ?撘????
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/xxxxx.git/'
?????????喳???ssh key, 銋??喲�???勗????撘?
?臭誑???�?Personal Access Tokens (雿隞交?隞???甈?),
?雿? github 鋆∠? Settings -> Developer settings,
??Personal Access Tokens, ?Y?雿? token
????雿隞亥撌勗?蝢拙?銋?????
銝?隞賢??舫��?token ?鈭???
閮剖?摰?敺? 撠勗隞亥?鋆賭???token
???餌 https clone ?撘?
??臭蝙?? 撣唾? + password (撌脩?銝雿輻鈭?,
?曉?寞?, 撣唾? + ????token 撠勗隞仿???clone 鈭?
???????�閬?clone 敺之??repo嚗銵?git clone
?賡?閬??瑞???嚗銝?瘜隞?
?�?clone ?�漲??:question:
?湔?????岫 ( 雿輻 django ?嗥?靘?)嚗?
git clone [email protected]:django/django.git
( 雿??潛 clone ?�閬?鈭???:triumph:)
?亥??亦? log嚗git log`
?岫?? branch git checkout stable/2.2.x
???孵?(?�? clone ????
?臭誑?? --depth
?�??訾?摰?嚗陛?株牧??銝????踝??嗆????砍銵?clone 銋?嚗?
?亥??瑁? git log
雿??潛?之?? log嚗?耨??銝?雿?賭??�閬暻澆???log嚗?
銋停?航牧雿?賢?�閬?餈?10 蝑? history commit嚗??喃??芷?閬?1 蝑?( 銋停?舀?砌??�閬?
history commit )嚗�??停敺?蝙??--depth
??
git clone [email protected]:django/django.git --depth 1
( 雿??潛?活敹怠?憭? )
?亥??亦? log嚗git log`
( ??敹怎????臬??箸??靽??�?啁?銝�蝑?history commit 嚗?
憒?雿?閬?餈?10 蝑??寞? --depth 10 ?喳 )
雿??銝�??憿??嗅?閰血???branch git checkout stable/2.2.x
( 雿??潛雿瘜???remote branch 😱
???臬??箔蝙??--depth
?貊?潭 --single-branch
嚗?
?�隞亦?嗆??隞? branch??)
銋停?航牧隞乩??拇??誘?嗅祕?舐蝑?
git clone git@github.com:django/django.git --depth 1
git clone git@github.com:django/django.git --depth 1 --single-branch
?箔?閫?捱?�?憿?瘥?憟賜??末?府?舫�見
git clone git@github.com:django/django.git --depth 1 --no-single-branch
( ?�? --single-branch
瘥?蝔凝銋?暺?嚗??箸???branch ???唬???history commit ?質? clone 銝? )
?見?店嚗停?臭誑靽? remote ??branch 鈭?
???? remote ??branch嚗?git checkout stable/2.2.x
??
?�敺?敺格??
憒? clone ?�餈?甈∠? history嚗�?銋?閬隞?branch嚗蝙?典?銝?
git clone [email protected]:django/django.git --depth 1 --no-single-branch
憒?雿閬?摰??? ?? -b
,
git clone [email protected]:django/django.git --depth 1 --no-single-branch -b stable/3.1.x
憒? clone ?�餈?甈∠? history嚗�?**銝?閬?*?嗡? branch嚗蝙?典?銝?
git clone [email protected]:django/django.git --depth 1 --single-branch
or
git clone [email protected]:django/django.git --depth 1
?游?閰喟敦?隤芣?隢???git clone
git status
?臭誑霈?????? repository ( repo 摰孵 )??
?�?桀?雿?撌乩??�?臭嗾瘛函???
git add ?�?????隞嗆?唳摮? ( Stage ) 嚗?
?嗅??瑁?
git commit 撠勗隞交??怠??� ( Stage ) 鋆⊥??耨?寧??批捆??桀????臭???
銝�?阡� ( git commit ) 敺?憒?雿?瘝?撠極雿??遙雿耨?對???獐撌乩??�撠望"銋暹楊"?�?
git commit -m "xxxxx" ?誘嚗?m 敺頛詨?摰寞?祆活靽格 ( ? ) ?牧??
?⊿?頛詨銝�?澆停?臭誑??活?靽格鈭?暻潛??批捆 ( ?嫣噶隞亙??閫�?敹恍�?閫?迨甈?commit 靽格鈭?暻?)??
隞乩? demo ?箏銝�???冗?扳憓???Hello.py 瑼?
?嗅?雿輻 git status 閫�??? repository ( repo 摰孵 )嚗?????Hello.py ?芾◤餈質馱嚗?銝?
?臭誑雿輻憒??誘
git add Hello.py
憿?鋆?嚗??a��?隞文??閎嚗之摰嗅隞亦?拍?
git add -p
?亥??蝙??
git commit -m "??"
git commit -m "add Hello.py"
?蝙??git status嚗???曉極雿?霈嗾瘛其???銝?
鋆?嚗???撓??
git commit
???歲?箇楊頛航?蝒?
???臭誑??斤? *Ins?? ( ???萇銝? ?望?摮?i ) ?喳頛詨??
頛詨摰???Esc?? 嚗?摰?摨???INSERT ??憭梧??亥??湔??:wq* 嚗???enter 撠望??脣?銝阡????
?游???臬???https://git-scm.com/docs/git-commit 隤芣???
憒?靽格?�敺?甈∠?commit???
??????commit 摰?敺???曇撌梁? commit ?批捆???鈭?
???隞乩蝙?典?銝?隞歹?隞?頝喳蝺刻摩閬?蝯虫?蝺刻摩雿?銝�甈∠? commit ?批捆??
git commit --amend
???舀???commit 摰?敺???曇撌望?鈭嗾??獢???add ?脣
???隞乩蝙?典?銝?隞?
git commit -m "init commit"
git add missing_file.py
git commit --amend
憒??�瘜?嗆? git commit -m "init commit" 銋?嚗?
??暹?瞍?鈭?missing_file.py ?�?獢?( commit ??閮?add ?脣 ) 嚗?
???停?臭誑雿輻 git commit --amend 靘耨?寞?敺?甈∠? commit ??
???????箔??嫣噶嚗?乩蝙?其??Y??誘銝�甈∪??亙?函?瑼?
git add .
雿??敺?曉撖行?鈭?獢銝?閬?add ?脣?????停?臭誑雿輻憒??誘?餃?瘨?add
git reset HEAD <file>
蝭?嚗楝敺???A.py 隞亙? B.py ???獢??嗅??蝙??git add . ?嚗?
雿??亙???曉撖?B.py ??瘝?閬?add ?脣嚗?隞交????停?臭誑雿輻 git reset HEAD B.py ?駁??�?
git push
撠?撘?push ??github ( or bitbucket 銋? )銝?, 憒???
git log
??撠神q ?舫��??
憒?閬箏??憭芷?嚗隞乩蝙?其???隞?
git log --pretty=oneline
??撠神q ?舫��??
?血?摨?銋銝�?? log ?撘? 敺 😆嚗???GUI ??閬綽? 靘??箸?蝡?敺???? 嚗?
git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit --date=relative
Git 銝哨?雿輻 HEAD 銵函內?桀????穿?
git reset --hard HEAD
憒??曉閬??桀???�?銝????穿?撠勗隞乩蝙??git reset ?誘嚗?
銝????砍停?浹EAD~1嚗?
git reset --hard HEAD~1
銝?銝�???砍停?浹EAD~2嚗?
憒?閬?摰??唳??摰??穿?
git reset --hard ad41df36b7
--hard
?�??賂???蝔桅?????--mixed
( default 嚗--hard
--soft`嚗?
--hard
?�??貊陛?株圾?停?臬?銋???commit ?賭??? 摰 *銝??? 嚗�?
--soft
?�??貊陛?株圾?停?臬?銋???commit ?賭???雿?靽? 雿??極雿????�?
--hard
??--soft
???閬箏??冽?摮?憟質牧???遣霅啣之摰嗉撌勗隞亙???拍?嚗停?臭誑鈭圾隞�???撌桃??
--soft
敺?蝙?典撠???儔??commit ?蔥????commit??
???( ad41df36b7 ) 瘝?閬?券撖恬?撖怠?撟曆?撠勗隞乩?嚗it ???整�?
?嗡??�??�??穿?蝒?予敺?鈭??單敺拙銋???閰脫�獐??
?曆??唳???commit id 閰脫�獐颲血?
???停?臭誑雿輻銝�??隞?
git reflog
?亥???閬??啣???穿??蝙??git reset ?喳??
git reset --hard 642e7af
???瘨( 閬? )撌脩? push ?箏??commit嚗�????隞乩蝙??
git push --force
??渡陛?剔?撖急?
git push -f
?臭誑撘瑕 push????�??穿??嗅??撥??push??
*瘜冽?嚗憭犖撠??勗?????⊿?銝???--force ?車?寞?嚗??箸??�?摰喳?乩犖嚗遣霅啣隞乩蝙??revert ??
?銝?�????�隞亙遣霅啁?虫?蝔格?頛??函??孵?
git push --force-with-lease
?臭誑蝣箔?雿??靘蹂??鈭箇? commit?? 憒??犖瘥???commit push 銝嚗?撠望??⊥? push ??remote 嚗?
銋??�?git switch ??git restore.
git checkout -- file
?臭誑銝?撌乩??�?耨?對?
git checkout -- hello.py
?賭誘 git checkout -- hello.py ?�停?荔???hello.py ?辣?典極雿??耨?孵?冽??( 銝? ) 嚗?
霈��?獢??唳?餈?甈?git commit ??git add ???�?�?
?嗥銋隞亦 git reset ?誘?湔??�?commit??
git reset --hard xxxxxx
git reset --hard 201f40604ec3b6fa8
?蝔桃?瘜?銝�蝔格蝣箏?閬??摨思葉?芷閰脫?獢???停?典隞?git rm ?芣?嚗蒂銝?git commit嚗?
rm hello.py
git rm hello.py
git commit -m "remove hello.py"
?虫?蝔桃?瘜?芷鈭?雿輻 git checkout ?臭誑頛???瑼?:
rm hello.py
git checkout -- hello.py
?刻牧????branch 銋?嚗?蝯血之摰嗡???敹萸�?
?虜?????憭批振?賣敺?master ??????branch ?箏嚗?敺? merge ??master嚗?
?箔?暻潸??獐? ? ?閬Ⅱ靽之摰園?臭蝙?冽??啁? master
雿輻 git branch ?誘?亦??桀????荔?
git branch
擐??萄遣銝�???荔?bug1 ? ( ?迂?臭誑?其噶??)嚗敺?? bug1 ?嚗?
git branch bug1
git checkout bug1
git branch bug1 ?箏????蝔梁 bug1 ???荔?
git checkout bug1 ?箏??銝�??蝔梁 bug1 ???臬?銝�?
隞乩??抵??誘嚗?嗆銝?銝�銵?隞?
git checkout -b bug1
(???之摰嗡????�撌? 隞乩??�?隞文隞亙翰????銝�???? ??cd -
璁艙銝�璅?exclamation:)
git checkout -
?� bug1 ?銝�脰?隞颱?靽格??嚗?
?嗅???撌乩??? ( 鋆?銝�銝?靽格隞颱??批捆敺?閮?雿輻 git add ?誘??git commit ?誘 ) ?蔥??master ?銝?
git checkout master
git merge bug1
git checkout master ?箏??銝�??蝔梁 master ???臬?銝�?
git merge bug1 ?誘?冽?蔥 ( bug1? ) ????啁????( master ) 摨???
憒??虜?嚗?git merge ???航ㄐ???Fast-forward嚗?雿菟�漲?虜敹怒�?
?嗥銝瘥活?蔥?質敺??拍??箇 Fast-forward嚗?憭????箇銵? CONFLICT ??
憒???蔥 ( merge ) 摰?敺?撠勗隞亙??(?祆?) bug1 ?嚗?
git branch -d dev
憒?閬??????◤?蔥???嚗隞乩蝙??git branch -D ??迂 撘瑁??芷 (?祆?)??
git branch -D dev
?????憭抵??芷 remote 蝡舐? branch 閰脫�獐颲血:question:
git push origin --delete {remote_branch}
鋆?嚗it branch 銋隞乩耨?孵?蝔梧??? commit id ?臭??霈?嚗蝙?冽瘜?敺陛?殷?
?臬???git-branch ?辣嚗蝙?冽瘜?銝?
git branch -m <name>
???b1 branch ???log 憒?嚗?
?曉撠?b1 branch 靽格??b2 branch嚗?
憒?雿?蝝啣?????log 瘥?嚗????log ??commit id ?臭??霈?嚗?
???????單葫閰行???commit ???? ???隞亦?亙??commit id ?餃遣蝡???branch,
?寞?憒?,
git checkout -b new_branch <commit id>
?見撠望?靘雿?摰? commit id ?餃遣蝡銝�??branch.
?訾縑憭批振??? github 銝?賣??嚗?銝?嚗?憭???
?????憒?撱箇???? 擐?嚗??????a�撐??
????v1 ???荔?銝虫???銝?????g.py 銝虫? commit??
?乩?靘? *蝚砌?甈? git push ???? 雿??潛?隤斗?蝷?
隢蝙?其誑銝?隞斗??舀迤蝣箇?
git push --set-upstream origin v1
銋隞乩蝙??
git push -u origin v1
?游?閰喟敦隤芣??臬???https://git-scm.com/docs/git-push#git-push--u
?乩?靘??臭誑?啁雯????( ?ㄐ??bitbucket ?嗡?蝭? ) 嚗???暹?? v1 鈭?
憒??舐洵銝�甈∩蝙??git clone 嚗???曆??芣? master ? 嚗?
???????亦??垢??隞�暻澆??荔?
git branch -r
git branch --remote
--remote
??-r
?賢隞?
?身?垢????蝔梁 develop ???荔?
?�閬?checkout ?啗府?摨?撠勗隞乩?
git checkout develop
Youtube Tutorial - git switch ??git restore ?飛
隢?蝣箄??桀???git ?, ?湔?寞??臬???git ?湔.
??git 2.23 ???, 憓?鈭?git switch
??git restore
, ???隞支蜓閬
閬皜??????? 銝餉??臭?隞? git checkout
.
雿撖血隞交??git checkout
= git switch
+ git restore
.
摰?辣?臬???git-switch
git switch [<options>] (-c|-C) <new-branch> [<start-point>]
???唬??歇蝬??函? branch (憒?閰?branch 銝??典??誘?⊥?)
git switch <new-branch>
撱箇? new-branch 銝虫?????new-branch ?
git switch -c <new-branch>
-c
--create
-C
--force-create
靘 commit_id (?? N ??commit 暺? 撱箇? new-branch 銝虫?????new-branch ?
git switch -c <new-branch> <commit_id>
git switch -c <new-branch> HEAD~2
(???之摰嗡????�撌? 隞乩??�?隞文隞亙翰????銝�???? ??cd -
璁艙銝�璅?smile:)
git switch -
Youtube Tutorial - git switch ??git restore ?飛
隢?蝣箄??桀???git ?, ?湔?寞??臬???git ?湔.
??git 2.23 ???, 憓?鈭?git switch
??git restore
, ???隞支蜓閬
閬皜??????? 銝餉??臭?隞? git checkout
.
雿撖血隞交??git checkout
= git switch
+ git restore
.
摰?辣?臬???git-restore
隞乩??拙�?隞斗?詨???
git checkout <file>
git restore <file>
???桀?鞈?憭曉?函?瑼?
git restore .
???桀?鞈?憭曉?銝?撠暹 *.py
??冽?獢?
git restore '*.py'
憒?雿? git
?瘥??? 雿?閰脫??潛?�?隞支?隞亙?憟賢?瘝???smile:
git restore --staged <file>
?虜?券?憪極雿?閬?push 銋?嚗????垢???嚗?
git pull
憒???蝒?閬?閫??蝒�?
??鋆?銝�銝?-C
?�??貊??�? 摰??�誨銵冽?摰?folder 頝臬?,
??????賭??喳? cd
?脣鞈?憭? ?�脰? pull, ????
撠勗??拙?雿輻摰?smile:
git [-C <path>] pull
??,
cd git_folder
git pull
?臭誑?湔蝪∪???
git -C git_folder pull
?臭誑?陛?格??git pull = git fetch + git merge
?�?靘?銝?撐?? git fetch + git merge
???撐?? git pull
?見?臭??舀?璆?鈭?!!
憭???????--prune
,
?�蜓閬???臬??remote ?⊥???branch,
?????歇蝬??垢??branch ?芷, 雿雿銵?git branch --remote
,
?餅??潛雿????圈鈭?branch ????(雿??雯?????臬歇蝬◤蝘駁鈭?sweat:)
撣詨虜?? pull 蝡??極雿垢)????(憒?銝??閰梁??�遣霅啁?敶梁?隤芣?:smile:)
???停?臭誑?郊銝�銝璈??垢???? 雿輻隞乩???隞?
git fetch --prune
隞�暻潭 rebase ??? git rebase 撠望?踹?憭? ( 瘝??儔 ) ??merge !!! ?????W撘萄?
鋆? :
ck = checkout
br = branch
st = status
cm = commit
?臭誑?芾?閮剖???
??
??
?? ???? 雿?甇∠??芰車??? 蝑?敺?憿荔????? !!
rebase ??蜓閬停?舐???????
?刻??之摰嗡?摰??嚗?隞交??湔撖行蝯血之摰嗥???
?內蝭?瘝?雿輻 rebase ??靘?
?桀??
隞乩?隤芣? : ?遣蝡?v1 branch嚗??add 敺? commit??
?身?曉??鈭?push 鈭?隞乩?璅⊥ pull 嚗撌勗?銝???commit
隞乩?隤芣? : ?芸楛??master ?銝? t2.txt 嚗?銝虫?commit ( 璅⊥ pull )
?乩?靘?????master ?銝? v1 branch ? ?蔥嚗蒂銝?push
雿??潛嚗*蝷箏靘??蒂銝?鈭殷?憒???
蝷箇? 雿輻 rebase ??靘?
??隞賢?砌?銝�璅?
隞乩?隤芣? : ?遣蝡?v1 branch嚗??add 敺? commit??
?身?曉??鈭?push 鈭?隞乩?璅⊥ pull 嚗撌勗?銝???commit
隞乩?隤芣? : ?芸楛??master ?銝? t2.txt 嚗?銝虫? commit ( 璅⊥ pull )
*撌桃?隞?
隞乩?隤芣? : ??? v1 ?嚗敺蝙?其誑銝?隞?
git rebase master
隞乩?隤芣? : ????master ?嚗蒂銝蝙??merge ?蔥 v1 ?嚗?敺 push
雿?~ ?臭??航??朣?瞍漁憭???
git rebase 撠望撠?master ????commit ?亙?靘???銝撌勗??舐? commit??
隞乩?撠望 git rebase ??蝝嫘�?
撠???僑頛?銝�?港誑??git rebase
撠勗?航? commit log ?絲靘?頛嗾瘛刻�歇嚗?????潛嚗?
git rebase
??interactive 頞撥嚗?隞伐???撠曹?隞晶 git rebase
?撥憭批???:smirk:
隞乩???git rebase interactive ?臭誑雿輻??隞歹???隤芣??舀?敺?git 銝剛?鋆賢靘?嚗?蝑?憿舐內蝯血之摰嗥?嚗?
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit
憒?憭批振?唾??湧�脖?甇亦?鈭圾嚗??�?INTERACTIVE MODE嚗?
pick 瘝?暻澆末雓?嚗停雿輻?�?commit ?歇:smile:
Youtube Tutorial - git rebase interactive - reword - PART 1
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
隞乩??箏??寧?隤芣?
If you just want to edit the commit message for a commit, replace the command "pick" with the command "reword".
隤芣?撌脩?敺?璆?嚗停?臬隞亦楊頛?commit message??
( 銝靽格 commit ?批捆嚗?撠望 files ?批捆 )
?身嚗?冽???銝�??git log ?舫�見嚗?
commit id 2659f65 ??Typo嚗迤蝣箇? commit message ?府?? add c.py ??嚗?
?�隞亦?刻?靽格迤隞??�??格? commit id ??2659f65嚗?隞斤
git rebase -i <after-this-commit>
after-this-commit ?�隞�暻潭???question:
蝪∪隤迎?撠望閬?嗡???commit id ??銝�??
隞仿��?摮?隤迎??�??格? commit id ??2659f65嚗??誘?�???
git rebase -i f0a761d
?見?府撠勗?皜?鈭?蝮賭?嚗?敺??豢??格? commit id ??銝�?停撠???
?嗡??? ENTER 銋?嚗??府???唬???
A ?隞賢停?舀???靽格?璅?B ??停?航牧??( ?鞎潛策憭批振???梯正 )嚗?
?亥?嚗? i ?脣蝺刻摩璅∪?嚗敺??格??寞? r ? reword ?賢隞伐??亥?頛詨 :wq
?亥??�??? ENTER嚗??歲?箔?甈∠?g?????雿停撠?commit 閮靽格??
甇?Ⅱ??撠? add c.py Typo 靽格??add c.py
頛詨 :wq
銋?嚗? ENTER ( 摰? )
?�???log 蝣箄?銝�銝? 憒???)嚗?蝣箔耨?寞???嚗???閮靽格??add c.py嚗?
???�?寡??之摰嗆?銝�銝?撠望 commit id ?霈????寡???寞??箔?蝯血?雿?嚗?
靽格??
靽格敺?
蝪∪靘牧嚗停?舐??commit id 銋???commit id ?賣??寡? ( ??蝜 😅 )
??鋆?銝�銝??芾?雿鈭?rebase嚗停???圈?隡潔??Y???
origin/master 撠望??蝡?( romote ) ??repo嚗??臬?雿牧雿?函? repo 撌脩???origin/master
銝?璅??嚗?隞伐?????憒?閬?push嚗?雿輻 git push --force-with-lease
??
???航?犖??嚗???撣?靽格蝚砌???commit 閰脫�獐颲?:question:
???隞乩蝙?剁?
git rebase -i --root
Youtube Tutorial - git rebase interactive - edit - PART 2
# Commands:
# p, pick = use commit
# e, edit = use commit, but stop for amending
隞乩??箏??寧?隤芣?
By replacing the command "pick" with the command "edit", you can tell git rebase to stop after applying that commit, so that you can edit the files and/or the commit message, amend the commit, and continue rebasing.
蝪∪隤迎?reword ?芸隞乩耨??commit message嚗�?edit 銝?臭誑靽格 commit message 嚗??臭誑靽格 files ?批捆??
????銝?撐??
??敺?憿?add a.py -> add b.py -> add c.py -> add d.py 嚗?冽??喳 add c.py ??add d.py 銝剖????镼選?
銋停?航???add a.py -> add b.py -> add c.py -> add c1.py -> add d.py ?見??
憓?銝�?? add c1.py ??憓?撠勗隞乩蝙??edit 鈭?( 隞乩??停銝牧??獐閰喟敦鈭???亥??? )嚗?
?銵誑銝?隞?( ?�??格???a7ed6ff 嚗?隞仿隞?銝???commit id嚗?撠望 f0a761d )
git rebase -i f0a761d
?活?�? pick 靽格??e ? edit ( 憒???)
?嗡??? ENTER 銋?嚗????唬???
A ?隞賣?臭誑靽格 commit message嚗?
B ?隞賢??臬?雿牧?嗡?靽格 ( 皛輯雲 ) 摰嚗隞亙銵?git rebase --continue
嚗?
A ?隞賣?????嚗??�?其??極??( 憓? c1.py )嚗?
擐?嚗??遣蝡???c1.py 瑼?嚗敺?git add c1.py
嚗??commit 隞?( 憒???)
???牧??嚗雿遛頞單?嚗?瑁? git rebase --continue
嚗撌?
? log 蝣箄?銝�銝?憭芰?鈭?:satisfied: ?????颱?
Youtube Tutorial - git rebase interactive - squash fixup - PART 3
# Commands:
# p, pick = use commit
# s, squash = use commit, but meld into previous commit
隞乩??箏??寧?隤芣?
The suggested commit message for the folded commit is the concatenation of the commit messages of the first commit and of those with the "squash" command,
蝪∪隤迎?雿??閬?憭�?commit ?蔥????雿輻 squash 撠勗?鈭?( 隞乩??停銝牧??獐閰喟敦鈭???亥??? )嚗?
?活?璅閬? commit id fc45824 隞亙? commit id a7ed6ff ?蔥韏瑚? ( 憒???)
?銵誑銝?隞?
git rebase -i f0a761d
?亥?雿??銝?嚗??? fc45824 ?�?cmmit ??pick 靽格??s ??squash
( 隞??蔥隞?????銋停??a7ed6ff )
( 憒?雿??蔥憭�?commit嚗停憭�?寞? s ??squash, 瘜冽?, ??摨�?exclamation::exclamation: )
撠??? ENTER嚗??銝?
????撌脩??蔥鈭�??commit嚗??停?臭誑頛詨?啁? commit message嚗?
???�撓??add c.py and c1.py
?? ENTER ( ?? )
?臭誑? log 蝣箄?銝�銝??�????拙�?commit ?蔥鈭?
c.py 隞亙? c1.py ?賢??剁?隞?”?�???:satisfied:
Youtube Tutorial - git rebase interactive - squash fixup - PART 3
# Commands:
# p, pick = use commit
# f, fixup = like "squash", but discard this commit's log message
隞乩??箏??寧?隤芣?
omits the commit messages of commits with the "fixup" command.
?嗅祕?�? squash 敺?嚗�虜憒??�?敹賜銝�??commit message 雿???commit ?摰對??�停?蝙??fixup嚗?
?格?嚗�??�閬宏??fc45824 ?�?commit ( 雿???commit ?摰?)
?銵誑銝?隞?
git rebase -i f0a761d
撠?fc45824 ??pick 靽格??f ??fixup ( 憒???)
( 隞?蝘駁 fc45824 ?�?commit message 嚗?靽? commit ?摰?)
?亥? ENTER嚗???rebase
?臭誑? log 蝣箄?銝�銝??�蕭?乩? add c1.py ?�?commit
雿 c.py 隞亙? c1.py ?賢???( ?芸蕭??commit message )嚗?
??ㄐ嚗之摰嗅撖血隞交銝�??squash ??fixup ???虜憿撮嚗?
?芯???squash ?臭誑靽格 commit message??
蝪∪銝�暺??桃??唾?敹賜????commit message ??雿輻 fixup嚗?
?唾??蔥 commit 銝虫耨??commit message ??雿輻 squash??
Youtube Tutorial - git rebase interactive - exec drop - PART 4
# Commands:
# p, pick = use commit
# x, exec = run command (the rest of the line) using shell
隞乩??箏??寧?隤芣?
You may want to check that your history editing did not break anything by running a test, or at least recompiling at intermediate points in history by using the "exec" command (shortcut "x")
?�??賣?瘥?撠嚗??隤芯?銝?蝪∪隤迎?撠望隞隞亦靘?check 雿?
rebase ?孵??臭??臬蔣?踹?湧? ( ??exec command 蝣箄? )??
?賭?憭芣? ❓ 瘝?靽?????憭拙?鈭?憭批???rabase ?游?嚗??蝣箄??�見??銋?嚗?
撠擃銝?蔣?選?銋停?臬隞亙?游????噶頝???test ?餌Ⅱ隤擃甇?虜 work??
??賭???:question: 銋???嚗??其???靘策憭批振??
憒??????閬??葉??鈭?test ?餌Ⅱ靽?????蔣?踵擃?
( ????賣 pick嚗?撠望瘝??雿靘輯牧??憭批振隢銵???孵?:sweat_smile: )
A ?隞?echo "test sucess" ?�?嗡??冽???嚗?
雿 B ??停???嚗??箸?祆???error ?�?隞歹?
?嗅??銵 shell ?隤斗?嚗???銝?嚗?雿耨甇??
憒????�??其? add c.py ?�?commit 銝???乩?靘? test error 鈭?
?????隞乩耨甇??憿?靽格迤摰?銋?嚗??瑁? git rebase --continue
??
?�??賣??單?閰脫霈??駁?靽格??雿撌梁? test嚗Ⅱ靽?甇?虜??
Youtube Tutorial - git rebase interactive - exec drop - PART 4
# Commands:
# p, pick = use commit
# d, drop = remove commit
隞乩??箏??寧?隤芣?
To drop a commit, replace the command "pick" with "drop", or just delete the matching line.
?�停蝪∪憭?嚗宏?日��?commit ( ? commit ?批捆 )嚗?
?身?�? log 憒?嚗?
?活?璅蝘駁 f0a761d ??980bd9a ??1539219 ?? commit嚗?
?銵誑銝?隞?
git rebase -i 8f13aaa
撠?pick 靽格??d ??drop ( 憒???)
??ENTER 銋?嚗???log 蝣箄?銝�銝?
敺??隞亦?橘??�歇蝬???蝘駁 f0a761d ??980bd9a ??1539219 ?? commit嚗?
銝虫?銋???commit ?批捆銋鋡怎宏?支?嚗?拐? a.py ?歇??
?Y隞晶摰? git fetch
隞亙? git rebase
銋?嚗銝???????鈭?git pull
憿???options ?
git pull [<options>] [<repository> [<refspec>?色�]
?游?閰喟敦?誘?臬???https://git-scm.com/docs/git-pull#_options??
?ㄐ蝪∪?渡?銝�銝?
git pull = git fetch + git merge
git pull --rebase = git fetch + git rebase
??git-rebase 銝剖歇蝬?憭批振鈭圾?唬蝙??git-rebase ?臭誑霈?code review ?犖
?絲靘?頛????�隞亙停雿輻 git pull --rebase
??( ???臭?閬???典凳??:smile: )??
???芋??git pull
隞亙? git pull --rebase
?榆?堆??噶??銵???瘜??甇仿??餃???
?�隞亙????喃?閫?憭???敹蛛?隢??誑銝????飛嚗?
Youtube Tutorial - git pull vs git pull --rebase
雿輻 git pull
敺?蝯?嚗ode review ?犖銝�摰蕃獢?( 憒???):triumph:
?????噶璅⊥銵?????雿??潛憒?雿輻 git pull
??銝�??commit (銋停?臭??寧? "fix conflict")??
雿輻 git pull --rebase
敺?蝯?嚗ode review ?犖銵函內皞恍成 ( 憒???):innocent:
?????噶璅⊥銵?????雿??潛憒?雿輻 git pull --rebase
銝虫?????銝�璅??鈭???commit嚗?
???臬??箇?�蝙??git pull --rebase
??銵???靽桀末銵??摰嫣?敺?git add xxxx嚗????
?湔?瑁? git rebase --continue
??
?身隞予雿銵? git pull --rebase
銋?嚗?曉???? 😨嚗閬?瘨?
?湔?瑁? git rebase --abort
?喳?銋????�?
憿?鋆?撠?撌?
隤芣? --autostash
,
銝�?砌?隤? 憒??�極雿銝�?? 蝒?唾??湔 git pull --rebase
, ????commit,
瘚?憭抒???銝?見
git stash # 撠???孵?摮�脣 stash 銝?
git pull --rebase
git stash pop # 撠????孵?敺?stash 銝?pop ?箔?
# 憒???蝒??餉圾瘙箄?蝒?
雿???甈⊿閬銵�獐憭?隞文撖行?????sweat:
雿隞仿�?銝�???訾?閫?捱, 銋停??
git pull --rebase --autostash
隞乩??挾?誘?箸銝停?臬鼠雿銵???銝???銝脩??梯正,
憒???蝒? 撠勗?靽格迤銵??喳:smile:
?蔣???湔?璆????葆憭批振????Youtube Tutorial - git-cherry-pick
git-cherry-pick ?�?隞文之摰嗅?賣?瘥???:confused:
瘝?靽??�?靘? 摰 ?牧??
git-cherry-pick - Apply the changes introduced by some existing commits
??摰隤芣??:question::question::question:
瘝?靽????身銝�??憓?( ?圾摰?雿停鈭圾鈭?git-cherry-pick ??? )嚗?
?身?曉 master ???log 憒???
?嗅?????v1 ????log 憒???
?曉????merge v1 ?銝剔? 14dee93 - add d.py ?�?commit
( ? 14dee93 ?�?commit 撖血憭芣?鈭??臬??箸?鈭???�閬��?commit )
?銝膩?車??嚗停敺?蝙??git-cherry-pick嚗?撠望隤芣??唾??嗡??銝剔??嗾??commit ?歇嚗?
銝?閬?剁??閰梯牧嚗停?舀?嗡??銝剔? commit ??雿輻??
鈭圾鈭??雿輻??嚗銝??�停靘祕??smirk:
擐?嚗??唾? v1 ?銝剔? 14dee93 - add d.py ?�?commit嚗?
?�隞交?????master ?嚗?銵?
git cherry-pick 14dee93
憒?雿閬?甈⊥敺????舫?靘??臬隞伐??湔雿輻蝛箇???喳
git cherry-pick 14dee93 xxxxxx xxxxxx xxxxxx xxxxx
憒?瘝?銵?嚗停???啣?銝?
????銝?master ??log
雿??潛?�??? v1 ?銝剔? 14dee93 - add d.py ?�?commit ?輸?靘?
雿輻鈭?雿?典???commit id ?餅 ab70429嚗��甇?虜???摰?閬?
??啗?蝞?smile:
?嗅祕嚗????git-cherry-pick 瘝??喳?銝剔??圈:satisfied:
??cherry-pick ????????啗?蝒????停??????蝒?蝭?嚗?
?身 master ??log 憒?
v1 ?銝剔? log 憒?嚗??唾?摰? 3a2f29a - add c.py and print world ?�?commit
v2 ?銝剔? log 憒?嚗??唾?摰? 553587b - add f.py?�?commit
?乩?靘??停?? master嚗敺?cherry-pick ???commit嚗?
??????橘?摰?蝒?:fearful:
雿輻 git status
??銝????嗅祕 A ????憒?閫??蝒?
擐?嚗???撠?c.py 靽格迤敺??瑁? git add c.py
嚗??? A ?隞?
?瑁? git cherry-pick --continue
嚗停?�?頝喳銝�?楊頛航?蝒?
頛詨摰?commit message 銋?嚗?頛詨 wq
嚗停???唬???
?�敺?????log嚗?
?�????�???commit merge ?唳??? master ?銝?:kissing_smiling_eyes:
?喃?閫?憭?雿輻?寞?嚗?�??寞?隞? https://git-scm.com/docs/git-cherry-pick??
?身??commit history ??A1 -> A2 -> A3 -> A4 -> A5 -> A6
??冽閬? A4 ?�?commit , ????撠勗隞乩蝙??git revert 嚗?
??revert A6
git revert A6
??revert A5
git revert A5
??雿???函? commit history , 隞??瑞??�見
A1 -> A2 -> A3 -> A4 -> A5 -> A6 -> A6_revert -> A5_revert
?????嗅祕雿? commit 撠望??A4 ?�?蝵???
雿輻 git revert ?末??撠望?臭誑靽? commit history, ?砌?雿?敺?鈭?
銋隞亙 revert ???
憒?雿閬?revert ?�?啁? commit, ?芷?閬蝙??HEAD
git revert HEAD
?券�脰??蔥????????憿舐內??銵?conflicts 嚗�??停敹???閫?捱銵?敺????
?虜???摰寞??銵? conflicts 嚗停?臭蝙??pull ?�?隞斤??�?
隞敦?�撐??憒?雿輻pull?�?隞歹??鼠雿??芸? merge ( 憒?鋆∠? Auto-merging Hello.py )嚗?
?嗅??亥???CONFLICT ( content ) : Merge conflict in Hello.py 嚗?隤?Automatic merge failed嚗?
撠望?迄雿? Hello.py ?�?獢?銵?嚗敺?敹???銝閫?捱銵???
git status ?臭誑?迄?�?蝒??辣??
??銵??辣?�?? Git ??<<<<<<<嚗?======嚗?>>>>>> 璅??箔????舐??批捆嚗??耨?孵??W???鈭歹?
?虜?�???銝靽格銵? conflicts嚗敺??�?commit
git add Hello.py
git commit -m "conflict fixed"
git merge --abort
??
git reset --hard HEAD
?臭誑???活??merge ? merge ?�?
敺??�??�迤?券??潔???????debug嚗敺??嗆?銝�???賡?閬??乩耨甇??
雿?????commit ?曉??瘜???寞瘝?蝢抬?鈭??芸?鈭???????stash
?�祕?函??誘撠望晷銝?港???
?�?摮??身?�鈭?A.py ??B.py ???獢?
?嗅?嚗?函??嗆?銝�??bug 敹?擐砌?(蝡)??嚗?
雿嚗???銝?鈭??????縊~~~
?????臭誑?拍隞乩??誘
git stash
??雿閬皜??芸楛?活??stash ???臭?暻潘???甇??隞�暻澆??? ?臭誑雿輻隞乩??誘
蝭?
git stash save "?閮餉圾"
git stash save -u "feature"
?隤芣?
-u
| --include-untracked
-a
| --all
?乩?靘??臭誑雿輻 status ?誘嚗???曇?銋暹楊鈭?
銝虫??臭誑雿輻銝???隞支?閫�??stash 鋆⊿?镼?
git stash list
?嗅?雿??芸??啗圾瘙粹��?bug嚗ommit 摰?敺? ?臭誑?蝙?其????誘??stash ??靘???隞文???銋??芷 stash
git stash pop
?身隞予雿?敺???stash嚗??臭誑??嚗?銝?(?貉撌勗?甇∠??冽?)
git stash pop 0
git stash pop stash@{0}
雿??潛???镼踹?靘?~
憒?雿??蝙??stash ??銋?嚗?撣??芷 stash 嚗隞乩蝙?其????誘
git stash apply
憒???雿隞亦?曉???嚗?stash 銝行??◤?芷
憒?雿?舀閬?斗摮??臭誑雿輻銝???隞?
git stash clear
敺??隞亦?橘?stash 鋆⊿?镼輯◤?�?支?
憒?雿銝?????stash嚗隞乩蝙??(?貉撌勗?甇∠??冽?)
git stash drop 0
git stash drop stash@{0}
Youtube Tutorial - git tag ?飛
?亦? tag
git tag
???摮?
git tag -l "v1.*"
-l
--list
git tag ??頛?蝝?蝐?lightweight tag) ???酉璅惜(annotated tag).
頛?蝝?蝐?lightweight tag)
憒??唾?撱箇?銝�??????蝐歹?隢?閬?摰?-a
-s
(GPG-signed) -m
git tag tag_name [commit_id]
憒??芯蝙??git tag tag_name
, ????敺 Commit id,
???芸???tag ?曉?桀??��?Commit id 銝?
憿舐內閮餉圾
git show v1.1-light
?酉璅惜(annotated tag)
git tag -a v1.1 -m "version 1.1"
-a
撠望璅惜?迂 --annotate
-m
隞?”閰脫?蝐方牧??閮餉圾)
?冽?摰? commit 銝身 tag
git tag -a v1.2 -m "version 1.1" [commit_id]
憿舐內閮餉圾
git show v1.1
頛?蝝?蝐?lightweight tag) ???酉璅惜(annotated tag) ?榆?亙停?舀?西??游??敦蝭�,
?酉璅惜(annotated tag) 憭??游???閮?
頛?蝝?蝐?lightweight tag) 憒?
?酉璅惜(annotated tag) 憒?
?嗡??瑁? git push
?身?臭??? tag ?典 remote.
?�閬銵誑銝??誘, push tag ??remote 蝡?
git push origin [tagname]
銝�甈?push 敺? tags (撠????券銝 remote 蝡舐? tag ??push 銝.)
git push origin --tags
?嗅隞犖?瑁? git clone
??git fetch
撠勗隞交?圈�? tags.
蝘駁?砍 tag
git tag -d [tagname]
?芷 remote tag
git push --delete origin [tagname]
銝�?砌?隤迎???其?靘??�?commit 靽格鈭鈭镼?
git show <commit ID>
git show [<options>] [<object>?色�
?嗡??渲底蝝啁?隞晶嚗??�?https://git-scm.com/docs/git-show
隞乩??箏??寡牧??
Show changes between commits, commit and working tree, etc
???嗾??摮?
瑼????脣?怠??� ( Stage )嚗?撠望?瑁? git add xxx 銋?嚗?
?臭誑??鈭鈭耨?對?
銋隞亦? commits 銋??榆??
?嗡??渲底蝝啁?隞晶嚗??�?https://git-scm.com/docs/git-diff
隞乩??箏??寡牧??
git-grep - Print lines matching a pattern
蝪∪隤迎?撠望?臭誑撟思??曉蝚血???pattern嚗???摮?????箏摰?
????hello ?�?pattern ??獢?????撠勗隞亙銵誑銝?隞?
git grep "hello"
?*蝷箏閰?pattern ?典�?獢誑?畾萇?撘Ⅳ??啜�?
?嗡??渲底蝝啁?隞晶嚗??�?https://git-scm.com/docs/git-grep
?望?�摰寧?敺格?頛?嚗?隞交??血?撖思?銝�蝭?
-
Youtube Tutorial PART 1 - git Submodule tutorial - how to create submodule
-
Youtube Tutorial PART 2 - git Submodule tutorial - how to update submodule
-
Youtube Tutorial PART 3 - git Submodule tutorial - how to clone submodule
-
Youtube Tutorial PART 4 - git Submodule tutorial - how to remove submodule
?望?�摰寧?敺格?頛?嚗?隞交??血?撖思?銝�蝭?
-
Youtube Tutorial PART 1 - git subtree tutorial - how to create subtree
-
Youtube Tutorial PART 2 - git subtree tutorial - how to push subtree
-
Youtube Tutorial PART 3 - git subtree tutorial - how to pull/create subtree
?�歇蝬身摰? user.name 隞亙? user.email 嚗? Git 銝撖阡???憭閮剖??镼?
?????�?????瑼? ( ?辣憭?) ?曉 Git 撌乩??桅?銝哨?雿?銝?漱摰�?
?撖Ⅳ閮剖??蝺刻陌??IDE ?Y??箔??镼蹂?憿?嚗?
瘥活 git status ?賣??蝝???Untracked files 嚗�虜?死敺?暺......
??憿?Git 銋鼠?�???芾???Git 撌乩??�??桅?銝撱箔??畾? .gitignore ?辣 嚗?
?嗅???敹賜??隞?( 瑼? ) ?迂頛詨?脣嚗?Git 撠望??芸?敹賜???辣??
?嗥銝?閬撌勗??剖神 .gitignore ?辣嚗?GitHub 撌脩?撟急?????銝�鈭?隞?gitignore
.gitignore 瑼??湔?曉?桅?摨??喳
銝餉????急?(Temporarily) ??瘞訾?(Permanently) ?gnore嚗?
- Temporarily ignore
?拙?雿輻??settings ??獢????????????賣??撌梁?閮剖?嚗?
雿��身摰敹憭批振?賡?閬?嚗�??停?臭誑?急??蕭?仿��?獢??寡???
?急?敹賜?�?獢?
git update-index --skip-worktree <file>
?W儔(Resume)?急?敹賜?�?獢?
git update-index --no-skip-worktree <file>
- Permanently ignore
??鋆?銝�??憓??身隞予 file ?�?獢歇蝬◤ commit ??git 銝凋?嚗?
雿???? .gitignore嚗�見閰脫�獐颲?question:
憒?雿 .gitignore 銝剖???file嚗???暸??舀??◤ ignore:confused:
????甇?Ⅱ??瘜?閰脫閬??瑁?撌脖??誘嚗?
git rm --cached <file>
?瑁?摰???commit ?喳 ( 瑼?銝?敺頂蝯曹??芷嚗?航??湔 git ??index ?歇 )
???隞亙??岫?湔 file ?摰對?雿??潛摰??◤ ignore 鈭?smile:
???虜撣豢?畾?key ?舀?隞斗??航?銝絲靘?
憒??�? git st 撠梯”蝷?git status ??府??璉?!!
?�隞交??隞亥撌梯身摰?霈?Git 隞亙???git st = git status 憒????銝雿輻 git st 嚗身摰?銋?撠勗隞乩蝙?其???
git config --global alias.st status
git config --global alias.br branch
git config --global alias.ck checkout
git config --global alias.sw switch
git config --global alias.cm commit
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
撠??a�?憭找葡霈?銝�????見隞亙??芷?閬銵?git lg
?喳嚗?
?航?犖??嚗?�身摰??辣?典鋆∪?
?虜?雿?雿輻??銝?靘??�?餉雿輻? HJ嚗身摰??辣撠望???C:\Users\HJ 摨?嚗?
隞銝�?? ?梯??辣.gitconfig 嚗????店?澆?憒???
銝?之摰嗆?瘝?瘜冽???--global
?�??賂?隞誨銵函??�?典???憒?隤芯?隞予?臬銵?
git config alias.stu status
隞?”?芣??刻府?桅?摨?????雿??
??��?隞�暻潛?g? 閰行銝�蝔格?憓??身雿?孵????冗摨?嚗閬蝙?函摰?靽∠拳??push嚗�隞?鞈?憭橘?
??璅?蝙?典?貊?靽∠拳嚗�???撠梢?撣賊?蝙?券�車?寞?摰???
?游?鞈?蝝啁??臭蝙?其誑銝隞斗??
man git-config
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
????憭?github ??嚗�見?臭??臬停銝 work 鈭?雿?賣?隤芣?啁垢?? ?
雿?.....憭?隞賜?撠憟賭? !! ?�ㄐ隞晶憒?銝�甈?Push ?啣??????垢 ( remote )
?ㄐ??Bitbucket ?嗡?蝭?
?蝙?其??寞?隞斗??
git remote -v
git remote ?�?隞斤??游?隤芣??臬????寞?隞?git-remote??
?亥??�蝙?其???隞斗憓???origin ??蝡?
git remote set-url --add origin <url>
git remote set-url --add origin git@github.com:twtrubiks/test2.git
?�???git remote -v ?亦?銝�甈∴?雿??潛憭????啣???蝡?( remote )
?�敺??? push
隞敦???臭??臭?甈?push ?啣??????垢 ( remote )嚗?撣豢靘?!
GitHub
Bitbucket
P.S 閮剖?瑼鞈?憭曉?銝??梯?瑼?".git" 摨?嚗ㄐ?X?銝�??config
鋆?撟曉�?git remote ??隞歹?隞??舀 rename 隞亙? remove 嚗?
?曉??remote 憒?嚗?
霈????啣??remote嚗?瘜?銝?
git remote rename <old> <new>
git remote rename origin2 origin
?瑁?敺?雿??潛 remote ??鋡思耨?寞? origin 鈭?
?乩?靘??岫閰?remove嚗?瘜?銝?
git remote remove <name>
git remote remove origin
???芷嚗??remote ?舐征??嚗?
?乩?靘???閰行憓???remote嚗?隞文?銝?
git remote add [-t <branch>] [-m <master>] [-f] [--[no-]tags] [--mirror=<fetch|push>] <name> <url>
git remote add origin git@github.com:blue-rubiks/t11.git
憒??�靽格 origin ??url嚗隞乩蝙??
git remote set-url origin git@blue.github.com:blue-rubiks/t11.git
Multiple SSH Keys settings for different github account
???臬?憭批振隤芯?鈭?? windows 隞亙? linux 摨?雿輻 git ?航???啁???.
擐?, ??linux 摨??瑁?隞乩??誘
sudo chmod -R 777 folder
git ??隤??箸霈? 閬�獐??敹賜??? 隢銵誑銝?隞?,
git config core.fileMode false
銋?��??? Git ignore file mode (chmod) changes
core.autocrlf
Windows 雿輻 Enter (Carriage Return 蝪∪神??CR) ????(Line Feed 蝪∪神??LF) ?????摰儔??,
??Mac ??Linux ?芯蝙?其???銵?(Line Feed 蝪∪神??LF) 摮?.
?�隞交?撠頝典像?啣?雿??箏?憿?
??windows 銝隞仿�見閮剖? ( 隞?” LF ?◤頧???CRLF)
git config --global core.autocrlf true
Linux ??Mac 蝟餌絞
git config --global core.autocrlf input
隞乩??見閮剖?, ? Windows 銝???CRLF嚗� Mac ??Linux 隞亙? repo 銝凋???LF.
憒?雿?湔楛?亦?鈭圾, ?臬????澆???core.autocrlf.
git config --global core.editor "vim"
???賣?撌梁?蝛嗅???嚗???撟怠?唳嚗??喲??菜??店嚗迭餈???銝�?臬???laughing:
蝬?蝘?ECPAY ( 銝?閮餃?? )
[韐??甈霄(http://bit.ly/2F7Jrha)
甇?撖?( ?�閮餃?? )
[韐??甈霄(https://payment.opay.tw/Broadcaster/Donate/9E47FDEF85ABE383A0F5FC6A218606F8)