Open Niarfe opened 5 years ago
Hi Heondo, the way the .gitignore usually works is that it covers any files listed. It covers paths to files within
the repo only obviously, and relative to the location of the .gitignore.
Also, beware that if you already checked in a file, .gitignore may not exclude it without you removing it first from git. But here's some examples...
This usually covers any fluff you don't want, like those pesky *.pyc files that generate when you run python sometimes. So...
.gitignore
at root of repo*.pyc
would mean exclude any pyc files. This covers any pyc files in root directory next to .gitignore. If you want to cover ANY pyc files recursively in the repo, the notation is **/*.pyc
meaning, any pyc in this , or recursive directory. Similarly for any other type of extension..pycharm/
or .vscode
etc.Most repos have a .gitignore with the basics
__pycache__
. There is a github repo with good starters, this is the python one... https://github.com/github/gitignore/blob/master/Python.gitignoreAlso...for credentials...
If you want to use a folder for creds, say for example config/myawscreds
is a file, but you don't want to check that in, you would do this....
condig/myawscreds.example
and put in the format... i.e.
[default]
aws_secret_key=
aws_key=
config/.gitignore
and in it put myawscreds
myawscreds
your other files can use that, AND the .gitignore guards you against accidentally checking it in. The example and .gitignore files have to be checked in, but after that you should be fine.FINALLY I got the reddit credentials into the config folder, made it so my scripts read from the text file to run. My scripts are definitely a structural mess, but well for now I just needed my reddit password and username away from the git repo. And, it's technically working now. Time to work on the lambdas functionality now....yeah. Once I figure out all of the, "clerical" work surrounding my scripts, I should probably rewrite it so that it is...just written well, thank you for this documentation it was basically all i needed
i tried to create a .gitignore text file. So my project is in ~reddit_pl/* Put my .gitignore.txt in reddit_pl/.git/ .gitignore.txt looks like rootkey.csv which is in reddit_pl/rootkey.csv. should it be ~/coding/reddit_pl/rootkey.csv ? Misplaced the file?