git似乎没有做我想要的,所以我需要一些建议.我有一个配置文件,其中包含密码等敏感信息.假设我已使用空白/通用值检入配置文件:
username =
password =
Run Code Online (Sandbox Code Playgroud)
现在我用实际值填充它,然后将文件添加到.gitignore(文件名是build.properties)
username = bob
password = secretpassword
Run Code Online (Sandbox Code Playgroud)
即使我已将它添加到.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")
Run Code Online (Sandbox Code Playgroud)
我误会了什么吗?
kni*_*ttl 21
.gitignore 只会忽略尚未签入的文件.在您的情况下,您需要创建一个password.file.template并检查它.然后将您的password.file放在.gitignore文件中.
| 归档时间: |
|
| 查看次数: |
2094 次 |
| 最近记录: |