git似乎没有做我想在这里,所以我需要一些建议。我有一个包含密码等敏感信息的配置文件。说我在空白/通用值的配置文件已检查:防止使用git密码文件的意外登记
username =
password =
现在我用实际值填充它,然后添加文件的.gitignore(文件名是build.properties)
username = bob
password = secretpassword
即使我已经将它添加到.gitignore,git仍似乎“看到它”。我应该在这里做什么?
hostname$ more .gitignore
build
ant.build
*.swp
build.properties
hostname$ git status
# On branch dev
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: build.properties
#
no changes added to commit (use "git add" and/or "git commit -a")
我误解的东西吗?
所以只是为了澄清,似乎如果有人做'git -a -m'whatever''它会自动检查密码仍然是? – corydoras
是的,如果它在版本控制下,它将包含在提交 – knittl