美文网首页
Git使用过程中ignore的一些使用问题

Git使用过程中ignore的一些使用问题

作者: 熊猫小贼_ | 来源:发表于2017-04-13 11:46 被阅读0次

关于Git的使用过程中的一些不必要的文件的提交

作者:邵雄华

第一种方法

1.cd到工程目录

cd /Users/shaoxionghua/ios/test

2.status一下

git status
(ps:会出现一下类似的东西)

  On branch develop
Your branch is up-to-date with 'origin/develop'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
    modified:   .DS_Store
    modified:   Live.xcworkspace/xcuserdata/shaoxionghua.xcuserdatad/UserInterfaceState.xcuserstate
no changes added to commit (use "git add" and/or "git commit -a")

3.rm这些不需要的文件或者路径

git rm --cached .DS_Store
git rm --cached Live.xcworkspace/xcuserdata/shaoxionghua.xcuserdatad/UserInterfaceState.xcuserstate

4.提交这些变更

git commit -m 'ignore'

5.最好执行一下pull和push

git pull
git push

第二种方法

1.cd到工程目录

cd /Users/shaoxionghua/ios/test

2.修改.gitignore文件

一般常见的一些设置如下:
(ps:在.gitignore文件里面写入如下内容,不要问我这个文件在哪里,不要问我怎么打开它,方法请自行百度或者google)

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

3.提交修改gitignore文件

git rm -r --cached .
git add .
git commit -m 'update .gitignore'

相关文章

  • Git使用过程中ignore的一些使用问题

    关于Git的使用过程中的一些不必要的文件的提交 作者:邵雄华 第一种方法 1.cd到工程目录 cd /Users/...

  • IntelliJ IDEA 插件推荐

    Lombok插件 .ignore插件 ignore插件是一个设置使用git提交代码时,设置忽略一些不需要提交到代码...

  • Git与Git flow使用笔记

    使用Git的一些真实的使用笔记,这不是理论,而是真实的使用过程中的一些笔记 基础Git与流程 git init 初...

  • Android studio 插件

    .ignore 是git使用时 配置有一些可以忽略的文件,GsonFormat 是json自动生成实体类使用

  • git tag、gitignore和git撤销提交

    [TOC] 前言 最近在git的使用过程中遇到了一些新的问题,所以写下来方便自己回忆。 git tag 打标签 g...

  • Intellij有逼格的插件

    Intellij有逼格的插件 1、ignore 经常使用git的同学对于ignore一定不会陌生,我们可以在该文件...

  • Git入门使用(一些常用操作)

    之前有篇文章已经讲到运用SourceTree来使用Git的方法,这几天使用过程中出现了一些小问题,解决之后在这里记...

  • Git 之.gitignore

    .gitignore,顾名思义——git ignore,是使用git管理项目时,存放忽略文件规则的文档。 对应规则...

  • gitignore入门

    一、gitignore的作用 顾名思义,git-ignore就是使用git提交时忽略哪些文件。 二、.gitign...

  • 配置Android Git .ignore文件

    使用git对项目进行版本控制时,总会因为编译生成的文件而发愁,.ignore的出现解决了这个问题。可以通过配置ig...

网友评论

      本文标题:Git使用过程中ignore的一些使用问题

      本文链接:https://www.haomeiwen.com/subject/zvlbattx.html