Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 忽略显示为未跟踪的文件_Git - Fatal编程技术网

Git 忽略显示为未跟踪的文件

Git 忽略显示为未跟踪的文件,git,Git,当我将项目移动到repo中的一个文件夹以保持所有内容的有序性时,整个问题就开始了。我想将令牌排除在git范围之外 我有一个.gitnore,如下所示: bot/__pycache__/* bot/token bot/staging_token *.pyc 由此,我假设令牌和staging_令牌都不应该被跟踪。 尽管如此,git状态显示: Untracked files: (use "git add <file>..." to include in what will be co

当我将项目移动到repo中的一个文件夹以保持所有内容的有序性时,整个问题就开始了。我想将令牌排除在git范围之外

我有一个.gitnore,如下所示:

bot/__pycache__/*
bot/token
bot/staging_token
*.pyc
由此,我假设令牌和staging_令牌都不应该被跟踪。 尽管如此,git状态显示:

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    bot/staging_token
    bot/token
和git add。。这就是结果:

On branch master
Your branch is ahead of 'origin/master' by 1 commit.
       (use "git push" to publish your local commits)

Changes to be committed:
        (use "git reset HEAD <file>..." to unstage)

    modified:   .gitgnore
    new file:   bot/staging_token
    new file:   bot/token

我应该怎么做才能使被忽略的文件不被跟踪?

您的输出将文件名显示为.gitnore。一定是的,我忽略了

On branch master
Your branch is ahead of 'origin/master' by 1 commit.
       (use "git push" to publish your local commits)

Changes to be committed:
        (use "git reset HEAD <file>..." to unstage)

    modified:   .gitgnore
    new file:   bot/staging_token
    new file:   bot/token