Enviar búsqueda
Cargar
Git tutorial for windows user (給 Windows user 的 Git 教學)
•
18 recomendaciones
•
9,634 vistas
Cloud Tu
Seguir
Tecnología
Denunciar
Compartir
Denunciar
Compartir
1 de 107
Descargar ahora
Descargar para leer sin conexión
Recomendados
Git Tutorial 教學
Git Tutorial 教學
Wen-Tien Chang
Git in a nutshell
Git in a nutshell
Nelson Tai
工程師必備第一工具 - Git
工程師必備第一工具 - Git
Alan Tsai
Git基礎介紹
Git基礎介紹
Max Ma
版本控制 使用Git & git hub
版本控制 使用Git & git hub
維佋 唐
Introduction to git
Introduction to git
Bo-Yi Wu
Git 版本控制 (使用教學)
Git 版本控制 (使用教學)
Jui An Huang (黃瑞安)
幸福快樂的完美結局
幸福快樂的完美結局
Anna Su
Recomendados
Git Tutorial 教學
Git Tutorial 教學
Wen-Tien Chang
Git in a nutshell
Git in a nutshell
Nelson Tai
工程師必備第一工具 - Git
工程師必備第一工具 - Git
Alan Tsai
Git基礎介紹
Git基礎介紹
Max Ma
版本控制 使用Git & git hub
版本控制 使用Git & git hub
維佋 唐
Introduction to git
Introduction to git
Bo-Yi Wu
Git 版本控制 (使用教學)
Git 版本控制 (使用教學)
Jui An Huang (黃瑞安)
幸福快樂的完美結局
幸福快樂的完美結局
Anna Su
Git與source tree 基礎教學
Git與source tree 基礎教學
Duncan Chen
Git由超淺入超深
Git由超淺入超深
羊 小咩 (lamb-mei)
A successful git branching model 導讀
A successful git branching model 導讀
Wen Liao
Git 入門與實作
Git 入門與實作
奕浦 郭
Visual Studio 2015 與 Git 開發實戰
Visual Studio 2015 與 Git 開發實戰
Will Huang
Git and git hub
Git and git hub
唯 李
Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀
Wen-Tien Chang
Yet another introduction to Git - from the bottom up
Yet another introduction to Git - from the bottom up
Wen-Tien Chang
初心者 Git 上手攻略
初心者 Git 上手攻略
Lucien Lee
Git and Github basic with SourceTree
Git and Github basic with SourceTree
Chu-Siang Lai
Gitlab
Gitlab
Tom Chen
Mercurial簡介與教學
Mercurial簡介與教學
芳本 林
連哈秋都懂的Git教學
連哈秋都懂的Git教學
hydai
寫給大家的 Git 教學
寫給大家的 Git 教學
littlebtc
Git 經驗分享
Git 經驗分享
Mu Chun Wang
git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用
Will Huang
Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹
PingLun Liao
Git flow 與團隊合作
Git flow 與團隊合作
Bo-Yi Wu
Git 入门实战
Git 入门实战
icy leaf
Git 使用介绍
Git 使用介绍
medcl
Pinkoi Mobile Web
Pinkoi Mobile Web
mikeleeme
Amazon Lumberyard (박 선용) - Amazed by AWS
Amazon Lumberyard (박 선용) - Amazed by AWS
Amazon Web Services Korea
Más contenido relacionado
La actualidad más candente
Git與source tree 基礎教學
Git與source tree 基礎教學
Duncan Chen
Git由超淺入超深
Git由超淺入超深
羊 小咩 (lamb-mei)
A successful git branching model 導讀
A successful git branching model 導讀
Wen Liao
Git 入門與實作
Git 入門與實作
奕浦 郭
Visual Studio 2015 與 Git 開發實戰
Visual Studio 2015 與 Git 開發實戰
Will Huang
Git and git hub
Git and git hub
唯 李
Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀
Wen-Tien Chang
Yet another introduction to Git - from the bottom up
Yet another introduction to Git - from the bottom up
Wen-Tien Chang
初心者 Git 上手攻略
初心者 Git 上手攻略
Lucien Lee
Git and Github basic with SourceTree
Git and Github basic with SourceTree
Chu-Siang Lai
Gitlab
Gitlab
Tom Chen
Mercurial簡介與教學
Mercurial簡介與教學
芳本 林
連哈秋都懂的Git教學
連哈秋都懂的Git教學
hydai
寫給大家的 Git 教學
寫給大家的 Git 教學
littlebtc
Git 經驗分享
Git 經驗分享
Mu Chun Wang
git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用
Will Huang
Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹
PingLun Liao
Git flow 與團隊合作
Git flow 與團隊合作
Bo-Yi Wu
Git 入门实战
Git 入门实战
icy leaf
Git 使用介绍
Git 使用介绍
medcl
La actualidad más candente
(20)
Git與source tree 基礎教學
Git與source tree 基礎教學
Git由超淺入超深
Git由超淺入超深
A successful git branching model 導讀
A successful git branching model 導讀
Git 入門與實作
Git 入門與實作
Visual Studio 2015 與 Git 開發實戰
Visual Studio 2015 與 Git 開發實戰
Git and git hub
Git and git hub
Git 版本控制系統 -- 從微觀到宏觀
Git 版本控制系統 -- 從微觀到宏觀
Yet another introduction to Git - from the bottom up
Yet another introduction to Git - from the bottom up
初心者 Git 上手攻略
初心者 Git 上手攻略
Git and Github basic with SourceTree
Git and Github basic with SourceTree
Gitlab
Gitlab
Mercurial簡介與教學
Mercurial簡介與教學
連哈秋都懂的Git教學
連哈秋都懂的Git教學
寫給大家的 Git 教學
寫給大家的 Git 教學
Git 經驗分享
Git 經驗分享
git merge 與 rebase 的觀念與實務應用
git merge 與 rebase 的觀念與實務應用
Git 程式碼版本控制軟體介紹
Git 程式碼版本控制軟體介紹
Git flow 與團隊合作
Git flow 與團隊合作
Git 入门实战
Git 入门实战
Git 使用介绍
Git 使用介绍
Destacado
Pinkoi Mobile Web
Pinkoi Mobile Web
mikeleeme
Amazon Lumberyard (박 선용) - Amazed by AWS
Amazon Lumberyard (박 선용) - Amazed by AWS
Amazon Web Services Korea
20141021 AWS Cloud Taekwon - Big Data on AWS
20141021 AWS Cloud Taekwon - Big Data on AWS
Amazon Web Services Korea
Windows 7 ls1
Windows 7 ls1
chrisbeks
Windows 10
Windows 10
Jeanine Osther
(MBL317) NEW! Introducing AWS Mobile Hub
(MBL317) NEW! Introducing AWS Mobile Hub
Amazon Web Services
AWS Architecture - GDC 2014
AWS Architecture - GDC 2014
Amazon Web Services
When Web meet Native App
When Web meet Native App
Yu-Wei Chuang
REST to RESTful Web Service
REST to RESTful Web Service
家弘 周
Windows Basic Computer Skills
Windows Basic Computer Skills
Marvin Nurse
windows and its components
windows and its components
prachi1210
Basic_Computer_Skills, A_seminar_by_Mohan_Kumar_G_Lecturer
Basic_Computer_Skills, A_seminar_by_Mohan_Kumar_G_Lecturer
Mohan Kumar G
Presentation Introduction to Windows
Presentation Introduction to Windows
MJ Ferdous
An introduction to Windows 10
An introduction to Windows 10
Cynoteck Technology Solutions Private Limited
Evolution of Microsoft windows operating systems
Evolution of Microsoft windows operating systems
Sai praveen Seva
人造交談語言 (使用有BNF的口語透過機器翻譯和外國人溝通)
人造交談語言 (使用有BNF的口語透過機器翻譯和外國人溝通)
鍾誠 陳鍾誠
Windows 10
Windows 10
KrishnaTeja Siva
Buffer's Top 10 Learnings Growing to $10 Million ARR
Buffer's Top 10 Learnings Growing to $10 Million ARR
Buffer
用JavaScript 實踐《軟體工程》的那些事兒!
用JavaScript 實踐《軟體工程》的那些事兒!
鍾誠 陳鍾誠
Front series A deck
Front series A deck
Mathilde Collin
Destacado
(20)
Pinkoi Mobile Web
Pinkoi Mobile Web
Amazon Lumberyard (박 선용) - Amazed by AWS
Amazon Lumberyard (박 선용) - Amazed by AWS
20141021 AWS Cloud Taekwon - Big Data on AWS
20141021 AWS Cloud Taekwon - Big Data on AWS
Windows 7 ls1
Windows 7 ls1
Windows 10
Windows 10
(MBL317) NEW! Introducing AWS Mobile Hub
(MBL317) NEW! Introducing AWS Mobile Hub
AWS Architecture - GDC 2014
AWS Architecture - GDC 2014
When Web meet Native App
When Web meet Native App
REST to RESTful Web Service
REST to RESTful Web Service
Windows Basic Computer Skills
Windows Basic Computer Skills
windows and its components
windows and its components
Basic_Computer_Skills, A_seminar_by_Mohan_Kumar_G_Lecturer
Basic_Computer_Skills, A_seminar_by_Mohan_Kumar_G_Lecturer
Presentation Introduction to Windows
Presentation Introduction to Windows
An introduction to Windows 10
An introduction to Windows 10
Evolution of Microsoft windows operating systems
Evolution of Microsoft windows operating systems
人造交談語言 (使用有BNF的口語透過機器翻譯和外國人溝通)
人造交談語言 (使用有BNF的口語透過機器翻譯和外國人溝通)
Windows 10
Windows 10
Buffer's Top 10 Learnings Growing to $10 Million ARR
Buffer's Top 10 Learnings Growing to $10 Million ARR
用JavaScript 實踐《軟體工程》的那些事兒!
用JavaScript 實踐《軟體工程》的那些事兒!
Front series A deck
Front series A deck
Similar a Git tutorial for windows user (給 Windows user 的 Git 教學)
Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)
flylon
Git introduction
Git introduction
mythnc
Learn git
Learn git
甘 李
Git原理与实战 201607
Git原理与实战 201607
Charles Tang
COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報
Bachue Zhou
Git Tutorial
Git Tutorial
Drake Huang
Android 程式設計(4)
Android 程式設計(4)
Roy Wang
Learning to Use Git | WeiYuan
Learning to Use Git | WeiYuan
Wei-Yuan Chang
Git 教學
Git 教學
Ming-Sian Lin
First meetingwithgit
First meetingwithgit
Rhythm Sun
Git Flow 管理
Git Flow 管理
Pu Lee
Git & git hub v1.2
Git & git hub v1.2
Chris Chen
20170510 git 懶人包
20170510 git 懶人包
Chen-Ming Yang
為自己學 Git
為自己學 Git
昀 李
Add mailinglist command to gitolite
Add mailinglist command to gitolite
琛琳 饶
Git & git flow
Git & git flow
Amo Wu
Submodule && subtree
Submodule && subtree
哲 于
Git使用进阶
Git使用进阶
Han Qin
Git+使用教程
Git+使用教程
gemron
Git Essence Tutorial
Git Essence Tutorial
Ho Kim
Similar a Git tutorial for windows user (給 Windows user 的 Git 教學)
(20)
Git 超簡單學習懶人包(軟體程式版本控管系統)
Git 超簡單學習懶人包(軟體程式版本控管系統)
Git introduction
Git introduction
Learn git
Learn git
Git原理与实战 201607
Git原理与实战 201607
COSCUP 2015 開源之道-Git工作坊教學簡報
COSCUP 2015 開源之道-Git工作坊教學簡報
Git Tutorial
Git Tutorial
Android 程式設計(4)
Android 程式設計(4)
Learning to Use Git | WeiYuan
Learning to Use Git | WeiYuan
Git 教學
Git 教學
First meetingwithgit
First meetingwithgit
Git Flow 管理
Git Flow 管理
Git & git hub v1.2
Git & git hub v1.2
20170510 git 懶人包
20170510 git 懶人包
為自己學 Git
為自己學 Git
Add mailinglist command to gitolite
Add mailinglist command to gitolite
Git & git flow
Git & git flow
Submodule && subtree
Submodule && subtree
Git使用进阶
Git使用进阶
Git+使用教程
Git+使用教程
Git Essence Tutorial
Git Essence Tutorial
Git tutorial for windows user (給 Windows user 的 Git 教學)
1.
Git tutorial for
windows user cloudtu http://cloudtu.blogspot.tw
2.
Agenda •
版控系統發展史 • Git設計目標 • 安裝Git • Git指令教學 • 常用的Git指令 • Git GUI工具教學(TortoiseGit) • Git基本守則 • 常用協同開發流程 • 參考資料 2
3.
Agenda •
版控系統發展史 • Git設計目標 • 安裝Git • Git指令教學 • 常用的Git指令 • Git GUI工具教學(TortoiseGit) • Git基本守則 • 常用協同開發流程 • 參考資料 3
4.
版控系統發展史
4 * 取自「Git Tutorial」
5.
版控系統發展史
5 * 取自「Git Tutorial」
6.
版控系統發展史
* 取自「Git Tutorial」 6
7.
Agenda •
版控系統發展史 • Git設計目標 • 安裝Git • Git指令教學 • 常用的Git指令 • Git GUI工具教學(TortoiseGit) • Git基本守則 • 常用協同開發流程 • 參考資料 7
8.
Git設計目標
* 取自「Git in a nutshell」 8
9.
Git設計目標
9 * 取自「寫給大家的Git教學」
10.
Agenda •
版控系統發展史 • Git設計目標 • 安裝Git • Git指令教學 • 常用的Git指令 • Git GUI工具教學(TortoiseGit) • Git基本守則 • 常用協同開發流程 • 參考資料 10
11.
安裝Git • 安裝流程 –
Step1.安裝msysgit • Git-1.7.11-preview20120710.exe – http://msysgit.googlecode.com/files/Git-1.7.11- preview20120710.exe – Step2.安裝tortoisegit • TortoiseGit 1.7.12.0(32-bit) – http://tortoisegit.googlecode.com/files/TortoiseGit-1.7.12.0- 32bit.msi • TortoiseGit 1.7.12.0(64-bit) – http://tortoisegit.googlecode.com/files/TortoiseGit-1.7.12.0- 64bit.msi • 補充說明 – TortoiseGit官方網址 • http://code.google.com/p/tortoisegit/ 11
12.
安裝Git • 安裝msysgit
只勾選這二項,接著「Next」連按完成安裝 只勾選這二項,接著「Next」連按,完成安裝 12
13.
安裝Git • 安裝tortoisegit
「Next」連按完成安裝,裝完後記的重開機。 13
14.
安裝Git • 安裝完成後
安裝成功的話,程式集中會出 現「Git」、「TortoiseGit」二 個目錄。 14
15.
Agenda •
版控系統發展史 • Git設計目標 • 安裝Git • Git指令教學 • 常用的Git指令 • Git GUI工具教學(TortoiseGit) • Git基本守則 • 常用協同開發流程 • 參考資料 15
16.
Git指令教學 執行程式集中的「Git Bash」就可以用指令模 式操作Git了… :
) 16
17.
Git指令教學 最簡單的指令:git
17
18.
Git指令教學(help) 查指令怎麼用:git help [cmd]
18
19.
Git指令教學(config) • 設定Git系統參數 –
設定自已在Git上的名字跟mail(用來區別自己和他人) git config --global user.name “my_name” git config --global user.email “my_name@email.com” – 查詢系統設定值:git config --global -l 19
20.
Git指令教學(init) 建立repository:git init .
20
21.
Git指令教學(init) Repository結構
頂層目錄叫做Working directory(工作目錄), 除了「.git」子目錄外的所有檔案與目錄都是 你正在編輯的資料(或開發的程式) 21
22.
Git指令教學(init) Repository結構
「.git」子目錄就是git repository。手動亂改裡 面的資料,會發生悲劇,不要手賤亂搞它。 22
23.
Git指令教學(add/commit) • 將working directory資料送進repository
git add . git commit -a -m “my comment” 23
24.
Git指令教學(add/commit) 將working directory資料送進repository
* 取自「Git in a nutshell」 24
25.
Git指令教學(add/commit) 將working directory資料送進repository
25 * 取自「Git Tutorial」
26.
Git指令教學(add/commit) 將working directory資料送進repository
26 * 取自「Git Tutorial」
27.
Git指令教學(add/commit) • 將working directory資料送進repository
– git add . • 將working directory裡「新增」與「修改」的檔案加到 staging area – git commit -a -m “my comment” • 將working directory裡「修改」與「刪除」的檔案加到 staging area,接著把所有staging area的資料給commit到 repository – 上面二個指令並用就能確保每次的commit都包含working directory裡所有「新增」、「修改」與「刪除」的檔案 27
28.
Git指令教學(add/commit) • commit基本原則 –
適當的粒度/相關性/獨立性 • 以一個小功能、小改進或一個bug fixed為單位 • 對應的unit test程式在同一個commit • 無相關的修改不在同一個commit • 語法錯誤的半成品程式不能commit – commit訊息很重要 • 第一行寫摘要 • 有需要寫實作細節的話,放第二行之後 * 取自「Git Tutorial」 28
29.
Git指令教學(status) 查看檔案狀態:git status
新增function1.txt檔案 29
30.
Git指令教學(status) 查看檔案狀態:git status
檔案狀態是”Untracked files”,這是什麼 東東? 30
31.
Git指令教學(status) 查看檔案狀態:git status * 圖表取自「Git
Tutorial」 想起來了嗎? 31
32.
Git指令教學(status) 查看檔案狀態:git status * 圖表取自「Git
Tutorial」 32
33.
Git指令教學(status) 查看檔案狀態:git status * 圖表取自「Git
Tutorial」 33
34.
Git指令教學(status) 查看檔案狀態:git status * 圖表取自「Git
Tutorial」 34
35.
Git指令教學(status) 查看檔案狀態:git status * 圖表取自「Git
Tutorial」 35
36.
Git指令教學(gitignore) • .gitignore
– 告訴Git哪些檔案類型不用進版控 – .gitignore大集合 • https://github.com/github/gitignore 36
37.
Git指令教學(diff/show) • commit之前看
檔案內容差異 – git diff – git diff [file_name] • commit之後看 檔案內容差異 – git show – git show HEAD^ – git show [file_name] 37
38.
Git指令教學(diff/show) • commit之前看
檔案內容差異 – git diff – git diff [file_name] • commit之後看 檔案內容差異 – git show – git show HEAD^ – git show [file_name] 38
39.
Git指令教學(diff/show) • commit之前看
檔案內容差異 – git diff – git diff [file_name] • commit之後看 檔案內容差異 – git show – git show HEAD^ – git show [file_name] 39
40.
Git指令教學(log) 查看commit的歷史記錄 • git log •
git log [file_name] • git log --graph --decorate --all 40
41.
Git指令教學(reset) • 檔案內容改爛了!怎麼辦? –
commit之前改爛了,恢復到修改前的內容 • git checkout [file_name] • git reset --hard – commit之後後悔了,恢復到前一版的commit • git reset --hard HEAD^ 41
42.
Git指令教學(reset) • 檔案內容改爛了!怎麼辦? –
未commit前改爛了,恢復 到修改前的內容 • git checkout [file_name] • git reset --hard – commit之後後悔了,恢復 到前一版的commit • git reset --hard HEAD^ 執行後,前一版的 commit(246924f18f45bef4cee3 c97de023edeb9468cd05)砍 掉。這招起手無回,砍掉後救 不回來,使用前請三思。 42
43.
Git指令教學(branch) 為何要使用branch(分支)?
* 取自「Git in a nutshell」 43
44.
Git指令教學(branch) 使用branch(分支)
* 取自「Git in a nutshell」 44
45.
Git指令教學(branch) 使用branch(分支)
「master」branch 「new_feature1」branch 「HEAD」代表目前所在位置。所以目前在 「new_feature1」branch的最後一個commit 45
46.
Git指令教學(branch) • 列出所有branch git
branch -a • 產生新branch git branch [branch_name] • 切換branch git checkout [branch_name] • 刪除branch git branch -d [branch_name] 46
47.
Git指令教學(branch) 列出所有branch:git branch -a
47
48.
Git指令教學(branch) 產生新branch:git branch [branch_name]
48
49.
Git指令教學(branch) 切換branch:git checkout [branch_name]
從「master」branch切到「new_feature2」branch 49
50.
Git指令教學(branch) 刪除branch:git branch -d
[branch_name] 50
51.
Git指令教學(tag) • 幫特定commit進行”貼標籤”動作,一般用來把將要上
線版本資料進行tag動作 • 列出所有tag git tag • 產生新tag git tag [tag_name] • 刪除tag git tag -d [tag_name] 51
52.
Git指令教學(merge) • 把其它branch接在current branch的尾巴 •
範例 52 * 取自「寫給大家的Git教學」
53.
Git指令教學(merge) • merge時衝到了(conflict),怎麼辦?
* 取自「寫給大家的Git教學」 53
54.
Git指令教學(rebase) • current branch的頭改接在其它branch之後 •
範例 git checkout experiment git rebase master rebase之前 rebase之後 * 取自「寫給大家的Git教學」 54
55.
Git指令教學(merge/rebase)
* 取自「寫給大家的Git教學」 55
56.
Git指令教學(merge/rebase) • 還是搞不清楚merge與rebase差異? –
多練習,多玩儿次就會懂。 – 一般狀況下大多用到merge,不會rebase其實 影響不大。 – 除非你(妳)搞的清狀況,Production repository 別亂 rebase。因此搞爛Production repository 的話,把搞爛的人拖出來毒打一頓。 56
57.
Git指令教學(remote)
• 又回到了這張圖… : ) • 前述指令都圍繞在local 端,現在要講server端指 令 57 * 取自「Git Tutorial」
58.
Git指令教學(remote) 離題一下,看看github這玩意兒 • https://github.com • 簡單來說就是商業公司提供的git
host服務;大廟一 間,超多專案放上面 • 談錢傷感情,不過github上只有public project host免 費,private project host要錢,好在價格便宜 58
59.
Git指令教學(remote) 離題一下,看看github這玩意兒 • 建立repository(step1)
59
60.
Git指令教學(remote) 離題一下,看看github這玩意兒 • 建立repository(step2)
60
61.
Git指令教學(remote) 離題一下,看看github這玩意兒 • 建立repository(step3)
61
62.
Git指令教學(remote)
我們在server端(github)建立了 remote repository,接著可以 在local端使用remote指令設 定server端名稱與位址 62 * 取自「Git Tutorial」
63.
Git指令教學(remote) • remote指令用來設定local端要連線至server端
時的連線位址 • 列出server端位址 git remote -v • 設定server端位址 git remote add origin https://github.com/cloudtu/git-demo.git • 刪除server端位址 git remote rm origin 63
64.
Git指令教學(remote) 列出server端位址:git remote -v
64
65.
Git指令教學(remote) 設定server端位址 git remote add
origin https://github.com/cloudtu/git-demo.git 65
66.
Git指令教學(remote) 刪除server端位址:git remote rm
origin 66
67.
Git指令教學(push/pull)
local端設定好server端位址後就可以 進行這二端點的資料同步(push/pull) 67 * 取自「Git Tutorial」
68.
Git指令教學(push/pull) • 把local端資料推送到server端 –
用push指令 • 推送所有branch到server:git push --all origin • 推送所有tag到server:git push --tags origin • 推送特定branch到server: git push origin master • 把server端資料拉回並合併到local端 – 用pull指令 • 拉回所有branch並合併到local:git pull origin • 拉回特定branch並合併到local:git pull origin master – 拉回並合併後把local repository搞的亂七八糟, 想要後悔! • 那就退回這次的動作吧:git reset --hard HEAD^ 68
69.
Git指令教學(push/pull) • push完成後的log
server端remote branch也會記錄在 log裡面 69
70.
Git指令教學(push/pull)
70 * 取自「寫給大家的Git教學」
71.
Git指令教學(push/pull) • pull =
fetch + merge * 取自「寫給大家的Git教學」 71
72.
Git指令教學(push/pull) • pull -
special case demo(step1) 72
73.
Git指令教學(push/pull) • pull -
special case demo(step2) 每個branch只有進行fetch,沒有 merge,要自己手動處理 73
74.
Git指令教學(push/pull) • pull -
special case demo(step3) 手動merge 74
75.
Git指令教學(clone)
server端已存有remote repository,local 端可用clone指令複製一份到local端 75 * 取自「Git Tutorial」
76.
Git指令教學(clone) • clone一份server端repository至local端
git clone https://github.com/cloudtu/git-demo.git git-demo 76
77.
Git指令教學(clone) • clone出來的repository裡,local branch只會有
master branch • 需要其它的local branch要自己建 77
78.
Agenda •
版控系統發展史 • Git設計目標 • 安裝Git • Git指令教學 • 常用的Git指令 • Git GUI工具教學(TortoiseGit) • Git基本守則 • 常用協同開發流程 • 參考資料 78
79.
常用的Git指令
* 取自「Git in a nutshell」 79
80.
常用的Git指令 想要快速複習一下?
都放在那裡了,自己去拿吧! 80 http://cloudtu.blogspot.tw/2012/08/git-command-fast-memo.html
81.
Agenda •
版控系統發展史 • Git設計目標 • 安裝Git • Git指令教學 • 常用的Git指令 • Git GUI工具教學(TortoiseGit) • Git基本守則 • 常用協同開發流程 • 參考資料 81
82.
Git GUI工具教學(TortoiseGit) TortoiseGit跟檔案總管直接整合,按下滑鼠右
鈕就可以直接使用… : ) 82
83.
Git GUI工具教學(TortoiseGit) 查TortoiseGit怎麼用
83
84.
Git GUI工具教學(TortoiseGit) • 設定Git系統參數
– TortoiseGit Settings 84
85.
Git GUI工具教學(TortoiseGit) 建立repository
85
86.
Git GUI工具教學(TortoiseGit) 將working directory資料送進repository
86
87.
Git GUI工具教學(TortoiseGit) • .gitignore
– 告訴Git哪些檔案類型不用進版控 87
88.
Git GUI工具教學(TortoiseGit) • commit之前看檔案內容差異
– TortoiseGit Diff 88
89.
Git GUI工具教學(TortoiseGit) • commit之後看檔案內容差異
– TortoiseGit Show Log double click it 89
90.
Git GUI工具教學(TortoiseGit) • 查看commit的歷史記錄
– TortoiseGit Show Log 90
91.
Git GUI工具教學(TortoiseGit) • 檔案內容改爛了!怎麼辦?
– commit之前改爛了,恢復到修改前的內容 • TortoiseGit Show Log Revert – commit之後後悔了,恢復到前一版的commit • TortoiseGit Show Log Reset 91
92.
Git GUI工具教學(TortoiseGit) 使用branch(分支)
紅底方塊表示目前正在使用的branch 綠底方塊表示目前未使用的branch 黃底方塊表示tag 92
93.
Git GUI工具教學(TortoiseGit) 新增、刪除、查詢、切換branch
93
94.
Git GUI工具教學(TortoiseGit) 新增、刪除、查詢tag
94
95.
Git GUI工具教學(TortoiseGit) • merge:把其它branch接在current
branch的尾巴 • 範例 95
96.
Git GUI工具教學(TortoiseGit) • rebase:current
branch的頭改接在其它branch之後 • 範例 96
97.
Git GUI工具教學(TortoiseGit) • remote指令用來設定local端要連線至server端
時的連線位址 – TortoiseGit Settings 97
98.
Git GUI工具教學(TortoiseGit) • 把local端資料推送到server端
– TortoiseGit push 98
99.
Git GUI工具教學(TortoiseGit) • 把server端資料拉回並合併到local端
– TortoiseGit pull 99
100.
Git GUI工具教學(TortoiseGit) • push完成後的log
server端remote branch也會記錄在 log裡面 100
101.
Git GUI工具教學(TortoiseGit) • clone一份server端repository至local端
101
102.
Agenda •
版控系統發展史 • Git設計目標 • 安裝Git • Git指令教學 • 常用的Git指令 • Git GUI工具教學(TortoiseGit) • Git基本守則 • 常用協同開發流程 • 參考資料 102
103.
Git基本守則 • 編輯文字檔案請用UTF8編碼 • 設定.gitignore,只commit必要檔案
– compiled binary、log 、temp file不要放到 repository • commit守則 – 每次commit只改一件事情 – 寫清楚commit message • 別對production repository下你不熟的git指令 • 「千萬不要」對已經push的東西作rebase 103
104.
Agenda •
版控系統發展史 • Git設計目標 • 安裝Git • Git指令教學 • 常用的Git指令 • Git GUI工具教學(TortoiseGit) • Git基本守則 • 常用協同開發流程 • 參考資料 104
105.
常用協同開發流程
105 * 取自「寫給大家的Git教學」
106.
Agenda •
版控系統發展史 • Git設計目標 • 安裝Git • Git指令教學 • 常用的Git指令 • Git GUI工具教學(TortoiseGit) • Git基本守則 • 常用協同開發流程 • 參考資料 106
107.
參考資料 • 寫給大家的Git教學
– http://www.slideshare.net/littlebtc/git-5528339 • Git in a nutshell(投影片) – http://www.slideshare.net/Dannvix/git-in-a-nutshell • Git in a nutshell(影片) – http://www.youtube.com/watch?v=1vkbR9itr0I • Git Tutorial – http://www.slideshare.net/ihower/git-tutorial-13695342 • TortoiseGit Intro in Traditional Chinese – http://www.slideshare.net/jason8301/tortoisegit-intro- in-traditional-chinese • Stackoverflow – http://stackoverflow.com/questions/tagged/git 107
Descargar ahora