加载中…
正文 字体大小:

如何在xcode中使用git

(2014-02-24 23:43:07)
标签:

xcode

git

github

repository

分类: 其他
1、安装git,官网有安装教程
2、在新建项目到时候会有如下选项

如何在xcode中使用git


如果创建项目到时候,没有选择创建repository,需要以下步骤进行设置

1)进入到该项目到目录下

$ cd Matchismo


2)找到xcuserstate,并设置到忽略文件夹中

find .   找到隐藏文件xcuserstate,用来记录UI的情况,可以不使用git来提交


.
./.DS_Store
./Matchismo
./Matchismo/.DS_Store
./Matchismo/Base.lproj
./Matchismo/Base.lproj/Main.storyboard
./Matchismo/Card.h
./Matchismo/Card.m
./Matchismo/CardGameAppDelegate.h
./Matchismo/CardGameAppDelegate.m
./Matchismo/CardGameViewController.h
./Matchismo/CardGameViewController.m
./Matchismo/Deck.h
./Matchismo/Deck.m
./Matchismo/en.lproj
./Matchismo/en.lproj/InfoPlist.strings
./Matchismo/Images.xcassets
./Matchismo/Images.xcassets/AppIcon.appiconset
./Matchismo/Images.xcassets/AppIcon.appiconset/Contents.json
./Matchismo/Images.xcassets/cardBack.imageset
./Matchismo/Images.xcassets/cardBack.imageset/cardBack-1.png
./Matchismo/Images.xcassets/cardBack.imageset/cardBack.png
./Matchismo/Images.xcassets/cardBack.imageset/Contents.json
./Matchismo/Images.xcassets/cardFront.imageset
./Matchismo/Images.xcassets/cardFront.imageset/cardFront-1.png
./Matchismo/Images.xcassets/cardFront.imageset/cardFront.png
./Matchismo/Images.xcassets/cardFront.imageset/Contents.json
./Matchismo/Images.xcassets/Image.imageset
./Matchismo/Images.xcassets/Image.imageset/Contents.json
./Matchismo/Images.xcassets/LaunchImage.launchimage
./Matchismo/Images.xcassets/LaunchImage.launchimage/Contents.json
./Matchismo/main.m
./Matchismo/Matchismo-Info.plist
./Matchismo/Matchismo-Prefix.pch
./Matchismo/model
./Matchismo/model/CardMatchingGame.h
./Matchismo/model/CardMatchingGame.m
./Matchismo/PlayingCard.h
./Matchismo/PlayingCard.m
./Matchismo/PlayingCardDeck.h
./Matchismo/PlayingCardDeck.m
./Matchismo.xcodeproj
./Matchismo.xcodeproj/project.pbxproj
./Matchismo.xcodeproj/project.xcworkspace
./Matchismo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
./Matchismo.xcodeproj/project.xcworkspace/xcuserdata
./Matchismo.xcodeproj/project.xcworkspace/xcuserdata/chris.xcuserdatad
./Matchismo.xcodeproj/project.xcworkspace/xcuserdata/chris.xcuserdatad/UserInterfaceState.xcuserstate
./Matchismo.xcodeproj/xcuserdata
./Matchismo.xcodeproj/xcuserdata/chris.xcuserdatad
./Matchismo.xcodeproj/xcuserdata/chris.xcuserdatad/xcdebugger
./Matchismo.xcodeproj/xcuserdata/chris.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
./Matchismo.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes
./Matchismo.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes/Matchismo.xcscheme
./Matchismo.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes/xcschememanagement.plist
./MatchismoTests
./MatchismoTests/en.lproj
./MatchismoTests/en.lproj/InfoPlist.strings
./MatchismoTests/MatchismoTests-Info.plist
./MatchismoTests/MatchismoTests.m


3)将文件导入到gitignore


bogon:Matchismo chris$ echo Matchismo.xcodeproj/project.xcworkspace/xcuserdata/chris.xcuserdatad/UserInterfaceState.xcuserstate >.gitignore   


bogon:Matchismo chris$ cat .gitignore
Matchismo.xcodeproj/project.xcworkspace/xcuserdata/chris.xcuserdatad/UserInterfaceState.xcuserstate

4)在项目文件目录下 执行指令:git init

bogon:Matchismo chris$ git init
Initialized empty Git repository in /Users/chris/developer/Matchismo/.git/

5)当前目录添加到git
bogon:Matchismo chris$ git add . 

bogon:Matchismo chris$ git commit -m "Now under sorce control”  第一次提交的注释
[master (root-commit) 3eb6864] Now under sorce control
 37 files changed, 1643 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 Matchismo.xcodeproj/project.pbxproj
 create mode 100644 Matchismo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
 create mode 100644 Matchismo.xcodeproj/xcuserdata/chris.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
 create mode 100644 Matchismo.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes/Matchismo.xcscheme
 create mode 100644 Matchismo.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes/xcschememanagement.plist
 create mode 100644 Matchismo/Base.lproj/Main.storyboard
 create mode 100644 Matchismo/Card.h
 create mode 100644 Matchismo/Card.m
 create mode 100644 Matchismo/CardGameAppDelegate.h
 create mode 100644 Matchismo/CardGameAppDelegate.m
 create mode 100644 Matchismo/CardGameViewController.h
 create mode 100644 Matchismo/CardGameViewController.m
 create mode 100644 Matchismo/Deck.h
 create mode 100644 Matchismo/Deck.m
 create mode 100644 Matchismo/Images.xcassets/AppIcon.appiconset/Contents.json
 create mode 100644 Matchismo/Images.xcassets/Image.imageset/Contents.json
 create mode 100644 Matchismo/Images.xcassets/LaunchImage.launchimage/Contents.json
 create mode 100644 Matchismo/Images.xcassets/cardBack.imageset/Contents.json
 create mode 100644 Matchismo/Images.xcassets/cardBack.imageset/cardBack-1.png
 create mode 100644 Matchismo/Images.xcassets/cardBack.imageset/cardBack.png
 create mode 100644 Matchismo/Images.xcassets/cardFront.imageset/Contents.json
 create mode 100644 Matchismo/Images.xcassets/cardFront.imageset/cardFront-1.png
 create mode 100644 Matchismo/Images.xcassets/cardFront.imageset/cardFront.png
 create mode 100644 Matchismo/Matchismo-Info.plist
 create mode 100644 Matchismo/Matchismo-Prefix.pch
 create mode 100644 Matchismo/PlayingCard.h
 create mode 100644 Matchismo/PlayingCard.m
 create mode 100644 Matchismo/PlayingCardDeck.h
 create mode 100644 Matchismo/PlayingCardDeck.m
 create mode 100644 Matchismo/en.lproj/InfoPlist.strings
 create mode 100644 Matchismo/main.m
 create mode 100644 Matchismo/model/CardMatchingGame.h
 create mode 100644 Matchismo/model/CardMatchingGame.m
 create mode 100644 MatchismoTests/MatchismoTests-Info.plist
 create mode 100644 MatchismoTests/MatchismoTests.m
 create mode 100644 MatchismoTests/en.lproj/InfoPlist.strings
bogon:Matchismo chris$ 

配置git 和github
git到详细用法:

0

阅读 评论 收藏 转载 喜欢 打印举报
  • 评论加载中,请稍候...
发评论

    发评论

    以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

      

    新浪BLOG意见反馈留言板 不良信息反馈 电话:4006900000 提示音后按1键(按当地市话标准计费) 欢迎批评指正

    新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 会员注册 | 产品答疑

    新浪公司 版权所有