How to unversion file in git and still keep it -
let's have file passwords, blank them out , commit/push. after git stop updating file, since putting in passwords in local git repo, don't want have remove them every time commit/push.
is there way unversion file in git still keep it?
my repo structure this:
> my-repo > folder1 > ... other stuff > folder2 > ... other stuff > folder3 > ... other stuff > launch.sh
i opened .git/info/exclude , added (last) line:
# git ls-files --others --exclude-from=.git/info/exclude # lines start '#' comments. # project in c, following set of # exclude patterns (uncomment them if want use them): # *.[oa] # *~ folder3/launch.sh
but nothing happens, git keeps versioning file , changes it, when add password, shows in git diff.
there 2 possibilities:
the better option git mv passwords.conf passwords.conf.example
, add passwords.conf
.gitignore
. is, don't put actual passwords file in git repo, template can used when people configure installation. setup script might conditional copy here.
the worse option use git update-index --assume-unchanged
. seriously, please don't. among other reasons, because have teach every single person cloning repo.
Comments
Post a Comment