1 / 22

版本控制 - git

版本控制 - git. o u tline. Git 安裝 ( github ) 建 repository Git 指令 c lone c ommit , log p ull c onflict 解決 . git. git : 用來做版本控制的工具 g it 下載頁面 : http://git-scm.com/ downloads m ac 的 Xcode 有內建 git ,所以不用再安裝 git Github : ㄧ個 git repository server ,並提供圖形化介面。

scot
Download Presentation

版本控制 - git

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 版本控制 -git

  2. outline • Git 安裝(github) • 建 repository • Git 指令 • clone • commit,log • pull • conflict 解決

  3. git • git :用來做版本控制的工具 • git 下載頁面:http://git-scm.com/downloads • mac 的 Xcode 有內建git,所以不用再安裝git • Github: ㄧ個gitrepository server,並提供圖形化介面。 • 帳號申請:https://github.com/ • Github 程式下載:https://help.github.com/articles/set-up-git • 其他推薦的git 程式: • sourceTree:http://www.sourcetreeapp.com/ • SmartGit :http://www.syntevo.com/smartgithg/ • Web 的Github 頁面:https://github.com/Duo0223/Web_JS_Example

  4. github • 從github clone ㄧ個 repository:cloneinDesktop

  5. github

  6. Github-commit • 開啓從github 上 clone 到電腦的repository • 例如:Web_Example/alert01.htm,把裡面的文字改成如下按了你會後悔喔!!! =>會後悔喔!!! • 在github 中即會顯示剛剛改動的地方

  7. Github–commit 上傳的按鈕 關於這次 commitmsglog

  8. Github-log

  9. Github-log

  10. Github-pull • 每次在 commit 前,最好先把專案更新到最新版。SyncBranch 按鈕

  11. Github-conflict • 如果,有不同的使用者,改到同ㄧ份檔案,那麼就很有可能會發生 conflict。那麼就需要去做 conflict 修正。 • 以下用ㄧ個例子說明: • 兩個使用者 userA , userB 對同ㄧ份檔案(alert01.htm)進行了修改。 • userA 先改完,並上傳了。 • userB 沒有先更新,就改了同ㄧ份檔案,並在上傳時發生了 conflict

  12. Github-conflict

  13. Github-conflict

  14. Github-conflict

  15. Github-conflict

  16. Github-conflict HEAD 這段是 userB (自己本機)改動的部分 HEAD 這段是 userA (server上)改動的部分

  17. Github-conflict • 先把衝突的檔案上傳

  18. Github-conflict • 然後打開衝突的檔案,手動修改

  19. Github-conflict

  20. Github-conflict • 再重新上傳

  21. Github-conflict

  22. Github–forweb • 請同學註冊github帳號 • 請同學把帳號給助教,讓助教可以加入共同開發者中。

More Related