01. 建立代碼倉庫(專門用于團隊開發的代碼倉庫)================================================================================# 切換目錄$ cd /Users/Desktop/git演練/公司/weibo# 建立空白代碼庫(專門用于團隊開發)$ git init --bare02. 項目經理準備項目(前奏)================================================================================# 切換目錄$ cd /Users/Desktop/git演練/經理# "克隆"代碼庫到本地$ git clone /Users/Desktop/git演練/公司/weibo/# 個人信息配置(因為要演示一臺機器上的多人協作,日常開發可以忽略)$ git config user.name manager$ git config user.email manager@163.com.gitignore--------------------------------------------------------------------------------.gitignore可以指定哪些文件不納入版本庫的管理參考網址:https://github.com/github/gitignore# 命令行中進入與.git同級的目錄$ cd /Users/Desktop/git演練/經理/weibo將以下命令一次性粘貼到命令行中--------------------------------------------------------------------------------echo -e "# Xcode#build/*.pbxuser*.mode1v3*.mode2v3*.perspectivev3xcuserdata*.xccheckout*.moved-asideDerivedData*.hmap*.ipa*.xcuserstate# CocoaPods## We recommend against adding the Pods directory to your .gitignore. However# you should judge for yourself, the PRos and cons are mentioned at:# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control## Pods/" > .gitignore--------------------------------------------------------------------------------# 將.gitignore添加到代碼庫$ git add .gitignore03. 創建項目================================================================================提交同時"push"到遠程代碼倉庫04. 新人加入================================================================================...05. 分布式的代碼庫 - 僅供參考================================================================================由于git是分布式的,任何一臺計算機上都保留有完整的代碼庫的內容,因此可以把團隊開發的代碼庫放在任何位置