.gitignore not working: files that should be ignored still get committed

后端 未结 9 1640
暗喜
暗喜 2020-12-24 12:37

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         


        
9条回答
  •  醉酒成梦
    2020-12-24 13:14

    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
    

提交回复
热议问题