【问题标题】:Gitignore does not ignore folder android, react nativeGitignore 不忽略文件夹android,react native
【发布时间】:2020-04-29 14:10:35
【问题描述】:

我已将文件夹 android 添加到 .gitingore 文件中,执行以下命令:

git rm -rf --cached . 
git add .
git commit -m "git"
git push origin master

文件夹 android 无论如何都会尝试推送,它有大文件,并且 git 会抛出文件 > 100 mb 的错误。

在处理我的 react-native 项目时,我在 MacBook 上发现了这个错误。

这是我的 gitignore

.expo/*
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
android/
*.orig.*
web-build/
android/
web-report/
# macOS
.DS_Store

【问题讨论】:

  • git status 的输出是什么?是您文件列表中的文件夹吗?并使用这个 .gitignore - gitignore.io/api/android
  • 在分支 master 上未跟踪的文件:(使用“git add ...”来包含将提交的内容) .editorconfig .eslintrc.js .expo-shared/ .gitignore .prettierrc 。 watchmanconfig App.js app.json assets/ babel.config.js index.js ios/ package-lock.json package.json src/

标签: android git react-native react-native-android gitignore


【解决方案1】:

您的 .gitignore 文件似乎可以正确排除 android 文件夹。

也许你在编辑 gitignore 之前提交了一个大文件?如果是,你可以看看如何remove the large files from the Git History

【讨论】:

  • 他用git rm -rf --cached . 删除了那些文件。
猜你喜欢
  • 2016-12-25
  • 1970-01-01
  • 1970-01-01
  • 2022-11-16
  • 2021-09-29
  • 2021-09-24
  • 2018-01-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多