git ignore

我最初将整个项目push到远程仓库,但是项目代码里面有大文件,从而传输太费时间了。

看网上的说法,可以通过ignore文件达到不提交某些文件的效果,尝试了一下发现不行。

后来尝试清除缓存

$ git rm -r --cached .

但是还是没有效果,原因是我之前已经commit了,push的时候之前的版本怎么样都要提交,于是我重新clone下来项目,然后填好ignore文件,最后add commit push,终于达到了想要的效果。

这个方法肯定不高明。

时间: 2024-08-23 23:42:33

git ignore的相关文章

pycharm添加git ignore

pycharm现在提供了git ignore,很方便 从这里下载扩展 https://plugins.jetbrains.com/plugin/7495--ignore 放到pycharm根目录\plugins目录下,直接拷贝过去就可以了 然后在project中,最上一层上点击右键,add,ignore,gitignore就可以了 编辑完成后要生效git ignore 在repo的根目录下运行:git rm -r --cached .git add .之后可以进行提交:git commit -m

intllij IDE 中git ignore 无法删除target目录下的文件

原因: git的本地忽略设置必须保证git的远程仓库分支上没有这个要忽略的文件,如果远程分支上存在这个文件,本地在设置ignore 这个文件,将会失败,无法commit忽略.(有人说是git的bug,本人猜测是git并没有考虑到这个需求) 我的解决办法,在本地删除targe目录中的文件,然后提交到远程分支,就可以了. ------------------------------------------------------- 关于.idea的文件夹中的workspace.xml设置ignore

Git ignore file for Xcode projects

http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects ########################## .gitignore file for Xcode4 and Xcode5 Source projects## Apple bugs, waiting for Apple to fix/respond:## 15564624 - what does the xccheckout file in

git ignore DS_Store

Remove existing files from the repository: find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch Add the line .DS_Store to the file .gitignore, which can be found at the top level of your repository (or created if it isn't there alread

Android Studio git ignore

# Built application files *.apk *.ap_ # Files for the Dalvik VM *.dex # Java class files *.class # Generated files bin/ gen/ # Gradle files .gradle/ build/ # Local configuration file (sdk path, etc) local.properties # Proguard folder generated by Ecl

Global Git ignore - Stack Overflow

https://stackoverflow.com/questions/7335420/global-git-ignore git config --global core.excludesfile '~/.gitignore' git config --get core.excludesfile https://help.github.com/articles/ignoring-files/#create-a-global-gitignore

git ignore不生效删除缓冲

在git中如果想忽略掉某个文件,不让这个文件提交到版本库中,可以使用修改根目录中 .gitignore 文件的方法(如无,则需自己手工建立此文件).这个文件每一行保存了一个匹配的规则例如: 1 2 3 4 5 6 7 # 此为注释 – 将被 Git 忽略 *.a       # 忽略所有 .a 结尾的文件 !lib.a    # 但 lib.a 除外 /TODO     # 仅仅忽略项目根目录下的 TODO 文件,不包括 subdir/TODO build/    # 忽略 build/ 目录下

git ignore 添加忽略文件不生效解决办法

在git中如果想忽略掉某个文件,不让这个文件提交到版本库中,可以使用修改根目录中 .gitignore 文件的方法(如无,则需自己手工建立此文件).这个文件每一行保存了一个匹配的规则例如: /target/ /target/* .gitignore .classpath .settings* 配置语法: 以斜杠“/”开头表示目录: 以星号“*”通配多个字符: 以问号“?”通配单个字符 以方括号“[]”包含单个字符的匹配列表: 以叹号“!”表示不忽略(跟踪)匹配到的文件或目录: git rm -r

git ignore已经checked in files

对于untracked file, 可以使用.gitignore 对于已经checked in file,可以使用git update-index #隐藏 git update-index --assume-unchanged xxxxxxxx #放开 git update-index --no-assume-unchanged xxxxxxxx