1. 在github上建立專案ShareScheme
2. 建立Xcode專案ShareScheme
3. 將Xcode專案ShareScheme和github做連結
git remote add origin https://github.com/deeplovepan/ShareScheme.git
git push -u origin master
4. 新增scheme "ShareScheme for peter pan"
從scheme清單裡點選Manage Schemes
新增ShareScheme for peter pan,並將Scheme列表裡欲共享的對象都勾選。( Shared欄位)
5. 將分享的scheme加入git管理
前一步勾選Shared後,專案下將生成xcshareddata資料夾,此資料夾下為我們想要和朋友共享的檔案。
(1) git status
->
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ShareScheme.xcodeproj/project.xcworkspace/
# ShareScheme.xcodeproj/xcshareddata/
# ShareScheme.xcodeproj/xcuserdata/
(2) git add ShareScheme.xcodeproj/xcshareddata/
(3) git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: ShareScheme.xcodeproj/xcshareddata/xcschemes/ShareScheme for peter pan.xcscheme
# new file: ShareScheme.xcodeproj/xcshareddata/xcschemes/ShareScheme.xcscheme
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ShareScheme.xcodeproj/project.xcworkspace/
# ShareScheme.xcodeproj/xcuserdata/
(4) git commit -a
(5) git push
經過以上步驟,當彼得潘的好朋友溫蒂從github下載ShareScheme專案時,將幸福地一次擁有ShareScheme和ShareScheme for peter pan兩個Scheme。
沒有留言:
張貼留言