git與source tree 基礎教學
TRANSCRIPT
![Page 1: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/1.jpg)
Git與SourceTree 基礎教學屏東科技⼤大學電算中⼼心
教學研究組
1
![Page 2: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/2.jpg)
⼤大綱
Git與SourceTree介紹
Git指令介紹
Git Flow介紹
實機操作
參考資料
2
![Page 3: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/3.jpg)
為何要版本控管??
版本控管可以吃嗎??
Git是啥???
Git與SVN有啥差別???
3
![Page 4: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/4.jpg)
Git介紹Git是⼀一個分布式版本控制/軟體配置管理軟體,原是Linux核⼼心開發者Linus Torvalds為更好地管理Linux核⼼心開發⽽而設計。
Git特點
•超快
•超簡單
•⽀支援⾮非線性開發
•完全分散式
•可以處理超⼤大的資料
4
![Page 5: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/5.jpg)
SourceTree介紹
SourceTree是⼀一套免費的Git GUI管理⼯工具,主要開發商為Atlassian,這套⼯工具可以⽀支援Windows、Mac、Linux。
這套⼯工具也有提供Git Flow的功能算是功能⽐比較⿑齊全與強⼤大的⼀一套⼯工具,本⼈人也是使⽤用這套⼯工具來做版本控管
5
![Page 6: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/6.jpg)
Git指令介紹
建⽴立⼀一個新的檔案庫 (Repository)
6
![Page 7: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/7.jpg)
Git指令介紹
複製別⼈人的檔案庫 (Clone)
7
![Page 8: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/8.jpg)
Git指令介紹
查詢歷史紀錄(log)
8
![Page 9: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/9.jpg)
Git指令介紹
查詢狀態(status)
9
![Page 10: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/10.jpg)
Git指令介紹
查詢所有分⽀支(branch)
建⽴立新分⽀支(new branch)
10
![Page 11: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/11.jpg)
Git指令介紹
切換分⽀支(checkout)
11
![Page 12: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/12.jpg)
Git指令介紹新增檔案(add)
12
![Page 13: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/13.jpg)
Git指令介紹提交(commit)
13
![Page 14: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/14.jpg)
Git指令介紹回原上⼀一版本(reset)
14
![Page 15: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/15.jpg)
Git指令介紹推送⾄至遠端檔案庫(push)
15
![Page 16: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/16.jpg)
Git指令介紹
取得遠端檔案庫更新(fetch)
16
![Page 17: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/17.jpg)
Git指令介紹從遠端檔案庫更新⾄至本地端(pull)
17
![Page 18: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/18.jpg)
Git Flow介紹Git Flow是⼀一個git的模型流程,這套流程定義了兩個分⽀支,⼀一個為主要分⽀支、⽀支援性分⽀支。
主要分⽀支:
• master:釋出的版本,只從 release 與 hotfix merge 回來,不直接在上⾯面 commit 變更。
• develop:開發中的版本,預設在這 branch 上,開發修改功能都從這分⽀支出去。
⽀支援性分⽀支
• feature:從 develop 分⽀支出來,當功能開發修改完成後 merge 回 develop。
• release:從 develop 分⽀支出來,是準備釋出的版本,只修改版本號與 bug,完成後 merge 回 develop 與 master,並在 master 標上版本號的 tag。
• hotfix:從 master 分⽀支出來,主要是處理已釋出版本需要⽴立即修改的錯誤,完成後 merge 回 develop 與 master,並在 master 標上版本號的 tag。
18
![Page 19: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/19.jpg)
實機操作
請從github上fork⼀一個專案,並複製到本機端後開始進⾏行專案開發
依序使⽤用教學上所教導的⽅方法將專案推送⾄至遠端檔案庫
展⽰示專案連結
19
![Page 20: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/20.jpg)
參考資料http://gogojimmy.net/2012/01/17/how-to-use-git-1-git-basic/
http://backlogtool.com/git-guide/tw/intro/intro1_1.html
https://ihower.tw/blog/archives/5140
http://www.sourcetreeapp.com/
https://github.com/
20
![Page 21: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/21.jpg)
Q & A
21
![Page 22: Git與source tree 基礎教學](https://reader034.vdocuments.mx/reader034/viewer/2022050720/55a648361a28ab552e8b47e3/html5/thumbnails/22.jpg)
謝謝⼤大家的聆聽
22