如何使用AndroidStudio中的特定软件包和文件禁用Git-Commit?
构建项目后,我有很多由Android Studio自动化的文件
,因此,当我尝试 commit
项目该项目时,提交部分已满,我不想>提交
或将
推向回购。
我怎么能告诉 git
不关心这些文件,也不提交或推出它们?
是什么
我尝试的 在 .gitignor
文件中添加dir dir,但似乎什么也没有发生。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然
git rm -cached -r- *.dex
就足够了,但不要忘记它只会从当前提交中删除这些文件。如果它们很大,并且永远不应该犯下,则需要将它们从提交的完整历史中删除(假设您是唯一一个在此存储库上工作的人,或者假设您可以
使用 git push -force ) -filter-repo“ rel =“ nofollow noreferrer”>
newren/git-filter-repo
再次,如果这些文件很小,并且具有有限的历史记录,则简单
git RM - cached
就足够了。While a
git rm --cached -r -- *.dex
should be enough, don't forget it will only delete those files from the current commit.If they are big, and should never have been committed, you would need to remove them from the full history of commits (assuming you are the only one working on this repository, or assuming you can warn your colleague about the impending
git push --force
)Using
newren/git-filter-repo
Again, if those files are small, and with a limited history, a simple
git rm --cached
is enough.