Git 忽略显示为未跟踪的文件
当我将项目移动到repo中的一个文件夹以保持所有内容的有序性时,整个问题就开始了。我想将令牌排除在git范围之外 我有一个.gitnore,如下所示: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
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