Weitere ähnliche Inhalte Ähnlich wie 電子內容管理 使用Git 與 github 1 (20) 電子內容管理 使用Git 與 github 12. 關於我
2
▰Alan Tsai 蔡孟玹
▰後端(攻城獅)工程師
▻Web Developer - 主要使用 .Net/C# 和 Asp .Net Mvc
▰看小說
▰找到我 – contact@alantsai.net
▻http://blog.alantsai.net - Alan Tsai 的學習筆記
▻{服務}.alantsai.net
▻http://fb.alantsai.net - fb
▻http://ln.alantsai.net – linkedin
▻http://ss.alantsai.net - slideshare
10. 第二代 – CVCS(Centralized) 集中式版控
10
▰有個中央Server記錄版本
▻可以多人使用
▰第一代問題是容易雙方互等
▻在commit(提交)的時候針對有重複的去做修正
▰典型程式有
▻Subversion (SVN),
Team Foundation Server (TFS),
CVS, SourceSafe,
來源:Pro Git P29 Figure1-2
11. 第三代 – D(Distributed)VCS – 分散式版控系統
11
▰不再只有一個中央系統
▻任何人裡面有記錄就是一個Repository
▻隨時可以commit
▻merge before commit
來源:Pro Git P30
Figure1-3
20. 版控 VS Google doc
20
▰版控 vs 一般文件
版控 Google Doc 評價
歷史記錄 永久 有時間限制 版控
隨時回復版本 永久 有時間限制 版控
任意版本比對修改 可以 不可以 版控
記錄修改的目的和版號 可以 不可以 版控
及時協同作業 非及時 及時 Google Doc
28. 使用組合
28
▰ CLI (powershell) + TortoiseGit
▻ CLI做一般操作
▻ TortoiseGit 做 歷史查詢(log),檔案比對(diff)和處理
conflict
▰ Source Tree + TortoiseGit
▻ Source Tree有點ide的感覺
▻ TortoiseGit在歷史查詢比較清楚
29. 安裝git – CLI工具
29
▰Git for Windows
▰包含git.exe、git bash、 git gui 、git lfs、git flow和Windows Credential Manager
▻https://git-scm.com/download/win
▻chocolate
#沒安裝過choclate 用 admin開啟 cmd 然後執行
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object
System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
&& SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateybin"
choco install git.install -params ‘“/NoShellIntegration”'
30. Git for Windows 安裝1
30
▰Windows Explorer Integration
▻建議不要勾,因為其他Gui工具就有提供
31. Git for Windows 安裝2
31
▰Use Git from Git Bash only
▻只有Git Bash能夠跑Git
▰Use Git from the Windows Command prompt(建議)
▻在Path上面加git – cmd就可以執行git
▰Use Git and optional Unix tools from Windows Command
Prompt
▻在Path加上git 和 安裝一些Unix工具
32. Git for Windows 安裝3
32
▰Windows 斷行吃 CRLF 而Unix吃 LF
▻Windows建議選第一個
▻Unix建議選第二個
▰這邊是設定版控儲存的斷行方式
▰這個可以安裝完成之後透過 git config設定
git config --system core.autocrlf “true” #第一個選項
git config --system core.autocrlf ”input” #第二個選項
git config --system core.autocrlf ”false” #第三個選項
36. Git Gui
36
▰TortoiseGit (俗稱 小烏龜,TortoiseSvn)
▻支援Windows
▻https://code.google.com/p/tortoisegit/
▰SourceTree
▻支援Windows 和 Mac
▻https://www.atlassian.com/software/sourcetree/overview
▰GitHub For Windows
▰ 更多 Gui 工具
▻ https://git-scm.com/downloads/guis
44. 設定檔案的層級和位置
44
System 層級
Unix - /etc/gitconfig
Windows – {Git安裝路徑}etcgitconfig
使用者層級
Unix - ~/.gitconfig 或者 ~/.config/git/config
Windows - %userprofile%.gitconfig
專案層級
在專案下的 .git/config
輕
46. 設定檔案的層級和位置
46
System 層級
Unix - /etc/gitconfig
Windows – {Git安裝路徑}etcgitconfig
使用者層級
Unix - ~/.gitconfig 或者 ~/.config/git/config
Windows - %userprofile%.gitconfig
專案層級
在專案下的 .git/config
輕git config –-system {參數}
git config –-global {參數}
git config {參數}
65. Git log –歷史
65
▰用git log指令可以看到歷史記錄
▻這個指令有很多參數
git log
git log --oneline --abbrev-commit --all --graph
81. 其他資源
81
▰Git官網 https://git-scm.com/
▻Pro Git https://git-scm.com/book/en/v2
▰Git指令圖解說明
▻http://marklodato.github.io/visual-git-guide/index-en.html
▰連猴子都能夠懂的Git入門指南
▻http://backlogtool.com/git-guide/tw/
▰關注我的部落格 – 特別是git標籤
http://blog.alantsai.net/search/label/Git
▰更詳細的投影片
大家應該都要會的工具 Git 從放棄到會用1-基礎篇
84. CREDITS
Special thanks to all the people who made and
released these awesome resources for free:
▰ Presentation template by SlidesCarnival
▰ Photographs by Startup Stock Photos
84
Hinweis der Redaktion 2005 問世
2008 年搭配github往上升 https://www.google.com.tw/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwj35dTWkqLVAhVHspQKHRD3CvcQjhwIBQ&url=http%3A%2F%2Freadinginternet-andrew.blogspot.com%2F2012%2F08%2Fwindows-7_31.html&psig=AFQjCNGLPJfJKnUu8HLBZIkbSudj8JA7tQ&ust=1500993259642755
https://www.google.com.tw/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwjZksmXkqLVAhVEoZQKHRA2DLEQjhwIBQ&url=http%3A%2F%2Fmrtang.tw%2Fblog%2Fpost%2F11068556-windows-vista%25E8%2588%2587xp%25EF%25BC%258C%25E9%25A1%25AF%25E7%25A4%25BA%25E3%2580%258C%25E9%259A%25B1%25E8%2597%258F%25E3%2580%258D%25E6%25AA%2594%25E6%25A1%2588%25E5%258F%258A%25E8%25B3%2587%25E6%2596%2599%25E5%25A4%25BE%25E7%259A%2584&psig=AFQjCNGLPJfJKnUu8HLBZIkbSudj8JA7tQ&ust=1500993259642755