I have one file that is necessary for my heroku app but that I do not want in my GitHub repository.
Is there any way to have a .gitignore
that is only used when pushing to GitHub?
Additionally, is there any other way that I can avoid pushing that one file to GitHub?
If you have already tracked this file, removing it (and even ignoring it in a .gitignore
) before pushing to GitHub will not remove it from the history of that pushed repository.
That means it is important to know why you do not want that file on GitHub.
If it is for security reason, because it includes sensitive information, you might have:
More generally, no, there is no conditional/separate .gitignore
for two different remote repository.
In your case, you might have to script your git push operation in order to play with, as in here, to play with git update-index --(no-)assume-unchanged <file>
.
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