使用git合并分支时.DS_Store和.xcuserstate文件冲突
来源:互联网 发布:澳洲股市行情软件app 编辑:程序博客网 时间:2024/06/05 09:20
今天在合并项目代码时,.DS_Store和.xcuserstate文件冲突无法合并。需要移除忽略.DS_Store和.xcuserstate文件。
1.打开终端,切换到项目路径, 输入 cd 项目路径 ,
2.创建.gitignore文件,此文件可创建需要忽略的类型文件,执行 vim .gitignore,输入
.DS_Store*.xcuserstate
按ESC,在输入:wq保存退出
3.在命令行输入
git rm --cached *xcuserstategit rm ---cached .DS_Store
按:再按wq退出编辑
4.执行
$ git add .gitignore$ git commit -m "Remove and ignore .xcuserstate and .DS_Store files."
添加并提交文件5.打开项目,解决其他项目文件冲突,合并代码
合并时可能会报
error: merge is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm '
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
执行
git add .
git commit -a -m "add ."
git pull origin master
git merge origin/master
成功解决!
参考资料:
https://stackoverflow.com/questions/21868857/removing-xcuserstate-and-ds-store-files-from-git
http://www.jianshu.com/p/4f69c79b295f
阅读全文
0 0
- 使用git合并分支时.DS_Store和.xcuserstate文件冲突
- git合并时忽略.DS_Store文件
- git分支的合并和冲突解决
- Git解决合并分支冲突
- 1git命令的使用,查看git仓库状态,添加文件到git跟踪,git提交,查看git分支,查看git仓库日志信息,切换git分支,解决git分支合并后出现冲突的问题
- .DS_store 文件冲突
- GIT 分支管理:创建与合并分支、解决合并冲突
- git 合并远程分支(带冲突)
- git 合并远程分支(带冲突)
- git---分支合并冲突处理(conflict)
- git分支合并,及冲突处理
- Git 分支管理-解决合并冲突
- git merge合并分支解决冲突
- Git 分支的合并以及解决冲突
- Intellij IDEA GIT 分支合并冲突
- git合并远程分支冲突解决方式
- git分支合并及冲突解决
- ignore .DS_Store and .xcuserstate
- NIO分散读取与聚集写入
- Logger的理解
- RAID类型级别(全是图)
- Appium-Desktop之iOS9.3+版本配置
- jndi(是什么)和ejb容器的关系
- 使用git合并分支时.DS_Store和.xcuserstate文件冲突
- Map的线程安全实现
- 实现不同虚拟用户具有不同家目录和权限
- 软件测试基本理论整理
- windows下Nginx、php-cgi启动和关闭脚本(开机自动启动)
- HBase DML DDL TTL(待完善)
- 你理解Android设备管理的妙用么?
- jQuery学习
- ccf 201612-4压缩编码