`

[IOS]如何结合XCODE使用git以及异常处理

    博客分类:
  • git
阅读更多

1.控制台cd到项目目录下,输入命令:git init

 

2.在git server创建xxx/project_name.git,输入命令:git --bare init

 

3.本地控制台:

git add .
git commit -m "first Commit"
git remote add origin git@git.oschina.net:tingkongwanli/git.git
git push -u origin master

 

4.这样就创建成功了,可以在xcode添加git,然后checkout下来(第一次),以后有更新从master pull下来最新代码

 

5.new a branch,然后可以写你自己部分的代码了。写完后可以commit(local)

 注释:merge from branch----从其他地方合并到我的branch

            merge into branch----把我的代码合并到其他branch

 

6.push:用于最终发送到server。切换回master,merge from branch,把最新修改的branch代码合并到master上,最后push上server上面

 

参考:http://www.jianshu.com/p/103d74b69a13

 

注意出现Git ignore UserInterfaceState.xcuserstate问题:

1.建立.gitignore,作用是让git忽略自定义规则;

 

2.项目目录下,新建.gitignore

touch .gitignore
open .gitignore

 

3..gitignore中输入

*.xcuserstate  
project.xcworkspace  
xcuserdata  
UserInterfaceState.xcuserstate  
project.xcworkspace/  
xcuserdata/  
UserInterface.xcuserstate 
.DS_Store

 

4.在命令行输入:

$ git rm --cached path/to/.DS_Store
$ git rm --cached *.xcuserstate

提交:
$ git add .gitignore
$ git commit -m "Remove and ignore .xcuserstate and .DS_Store files."

 

这时候在xcode进行merger,会提示commit:

控制台输入命令:

git rm --cached ProjectFolder.xcodeproj/project.xcworkspace/xcuserdata/myUserName.xcuserdatad/UserInterfaceState.xcuserstate
git commit -m "Removed file that shouldn't be tracked"

 再merge,成功

 

注意:要切换到出问题的branch下才能找到UserInterfaceState.xcuserstate,要不会报错

分享到:
评论

相关推荐

    IOS开发Git在Xcode开发环境下的使用

    从零来讲如何在xcode下,来配置git

    Xcode模拟器下载地址(iOS 8 - iOS 12)

    Xcode 模拟器手动下载地址,内容只包含从iOS 8 - iOS 12 之间的各个小版本。

    很好用的Xcode qmui-ios-codesnippets

    很好用的Xcode qmui-ios-codesnippets直接下载 或者到https://github.com/QMUI/QMUI_iOS_CodeSnippets下载

    Xcode.5.Start.to.Finish.iOS.and.OS.X.Development

    Title: Xcode 5 Start to Finish: iOS and OS X Development Author: Fritz Anderson Length: 624 pages Edition: 1 Language: English Publisher: Addison-Wesley Professional Publication Date: 2014-05-16 ISBN-...

    ios-Xcode自动打包工具 分发测试.zip

    使用自动打包工具 只需要1.配置好项目路径和蒲公英的关键; 2。设置打包模式,3.comman R 静静享受自动化带来的快感!下载地址https://github.com/chuheridangwu/XBPackagingTool.git 少年不哭!站起来撸!!!

    显示git增量的Xcode插件

    这个源码是显示git增量的Xcode插件,源码GitDiff,GitDiff是一个Xcode插件,如果你的工程使用Git做版本控制,它能提示你的代码的改变。 测试环境: Xcode 6.0 安装: 下载代码,运行工程,重启Xcode

    ios8真机下编译ffmpeg库

    source ffmpeg org ffmpeg git回车就可以下载 然后把ffmpeg目录复制到 sh文件所在目录下即可">xcode6 0 1 ios8sdk 编译ffmpeg库 可以编译armv7 armv7s arm64 模拟器的找了好多资料没有编译通过 如果没有更新xcode和...

    Git可视化工具SourceTree的使用

    我在前面几篇文章中详细介绍了Git命令行的使用《Git学习札记》《Git学习札记——进阶》,以及使用Xcode中自带的Git可视化工具的使用《Xcode中git的使用方法介绍与"Please tellmewhoyouare"问题的解决方案》。对于Git...

    iOS-Tagent-master.zip

    网易airtest for mac必备agent, iOS-Tagent 其实就是 WebDriverAgent 仔细看,会发现iOS-Tagent会比WebDriverAgent简略得多。...git clone https://github.com/AirtestProject/iOS-Tagent.git 然后用Xcode打开...

    iOS-Tagent:iOS自动化支持代理

    iOS-Tagent简介 iOS-Tagent是一个基于facebook 的项目,旨在适合 。 我们对其进行了一些自定义的优化和调整,它在以下方面效果很... 1.2使用Xcode打开iOS-Tagent并使用数据线将iPhone连接到Mac 在Xcode的顶部菜单中选

    ios-SwiftMan是Swift3的extension和帮助类的集合.zip

    Run carthage update to build the framework and drag the built SwiftMan.framework into your Xcode project. CocoaPods CocoaPods is a dependency manager for Cocoa projects. You can install it with ...

    SwiftOpenPose:基于tf-openpose的iOS项目

    Xcode9 训练模式 此项目有两种学习模型。 OpenPose Caffe模型 tf-openpose Mobilenet模型(instance_normalization禁用版本) ..模型训练和转换器 ..模型下载 性能比较 BenchMark硬件:iPad 2017 OpenPose ...

    iOS-Development:iOS 框架、文章、电子书等列表

    #iOS-开发 面向开发人员的 iOS 框架、文章、电子书等列表。 使用生成的目录 存储库 系统 Swift 工具 Xcode 包管理器 ... Xcode 和 git:弥合差距 CocoaPods 库 数据处理 NSDate-TKExtensions - NSDa

    iOS调试工具AllYourMemoriesAreBelong2iOS.zip

    应用收到该通知后,应该立刻释放当前不需要使用的资源以及后期可以重新创建的对象。视图控制器在收到该通知的同时还会收到 didReceiveMemoryWarning 消息,并且应用的 AppDelegate 也会收到 ...

    ns-v8ios-runtime:使用V8引擎的NativeScript iOS运行时

    要开始进入v8 iOS运行时,请确保已安装XCode和 ,然后运行以下命令 # Clone repo git clone https://github.com/NativeScript/ns-v8ios-runtime.git # Install CMake and LLVM (8) brew install cmake llvm@8 # Open...

    ios-test:Blinkbox Books iOS 应用程序的 Cucumber 和 Calabash 测试

    但是,需要使用在系统上安装 Xcode用法Git 克隆并拉取 :iOS/BBBIosApp.git xcodebuild -target BBBApp -scheme BBBQA -configuration Release -sdk iphonesimulator7.1 clean build 典型用法 bundle installrake ...

    RxSwift-MVVM-iOS:SwiftMVVM是使用MVVM架构以Swift编写的示例iOS应用

    带有RxSwift的MVVM RxSwiftMVVM是使用MVVM架构以RxSwift编写的示例iOS应用。示例应用运行样本克隆此存储库。 git clone git@github.com:yokurin/RxSwift-MVVM-iOS.git在Xcode中打开RxSwiftMVVM.xcworkspace 。 跑...

    《iOS6开发指南》精彩书摘

    学习如何使用Git进行代码版本控制,其中包括Git服务器的搭建,Git常用命令,协同开发,还介绍了Xcode中配置和使用Git工具。 第19章“把你的应用放到App Store”。掌握如何在App Store发布应用。介绍应用发布流程以及...

Global site tag (gtag.js) - Google Analytics