.gitignore不适合我 [英] .gitignore not working for me

查看:121
本文介绍了.gitignore不适合我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从现有文件夹创建一个新的git存储库。我在文件夹的根目录下创建了一个 .gitignore 文件。但如果我说
$ b $ pre $ g $ g $ g $ b $ git commit $ b $ git push
$ / code>

应该忽略的文件仍然会提交到远程存储库。我在Windows上。
我也购买了SmartGIT的许可证。它似乎也忽略 .gitignore 。我必须手动选择要提交哪些新文件。



我在做什么错?

解决方案

$ b

此外,它适用于我在Linux上):

 
$ git init
$ echo foo> .gitignore
$ echo foo> foo
$ echo bar> bar
$ git add -v *
您的.gitignore文件会忽略以下路径:
foo
如果您真的想使用-f添加它们。
致命:没有添加文件


I'm trying to create a new git repository from existing folder. I've created a .gitignore file in the root of the folder. But if I say

git add *
git commit
git push

files that should be ignored still get committed to the remote repository. I'm on Windows. Also I've bought a license for SmartGIT. It also seems to ignore .gitignore. I have to manually select which new files to commit.

What am I doing wrong?

解决方案

Try "git add ." instead.

Also, it works for me (on Linux):

$ git init
$ echo foo > .gitignore
$ echo foo > foo
$ echo bar > bar
$ git add -v *
The following paths are ignored by one of your .gitignore files:
foo
Use -f if you really want to add them.
fatal: no files added

这篇关于.gitignore不适合我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆