I couldn't find anything specific to this but if I missed it please let me know.
I have a file in git which needs to be there. Once pulled down each individual will need to edit it to add their own credentials to it. When edited by the individual I do not want it to show up as having been changed or anything because we want to keep the generic file without credentials in our repo. Is there an option to have a file set up as "Pull this file but never push it"? Currently the setup we have is the file is named Upload.bat_COPY_EDIT_RENAME, which hopefully makes it obvious what to do, and I have Upload.bat in the .gitignore. I'd like something more idiot proof.
I know there are options like --assume-unchanged but I don't want to have to run that every time and it seems kind of like a bandaid fix which could potentially cause problems later.
Thanks for your help!
I would suggest a slightly different approach... You can write your Upload.bat
to read from a settings file using your format of choice. Say you call it, secrets.txt
. Then you can add secrets.txt
to your .gitignore
and commit Upload.bat
with impunity. When users pull the repo, they will get Upload.bat
and can create their own secrets.txt
.
You might make secrets.txt
have just the username and password, separated by a newline. Should be trivial to parse this way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With