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