GitIgnore Notes
.gitignore
file
We will often want to add files to the repository directory just to make the bot run on our personal machines. We may not want to include these files in the actual repo as they are specific to testing. For instance, a config file that stores user information of the server that the bot is running on would be an example. We would not want user information of the test environment going on the main repository.
This is accomplished by adding these files to a file called .gitignore
. Just add file or directory names to the file. If the file or directory you want to ignore is not in the main directory, add another .gitignore
file in its directory.
Example:
Location of the .gitignore file
NOTE: Comments can and should be added for each entry explaining why or what the entry is for. Comments are denoted by the ‘#’ at the beginning of the line.
Example of gitignore in sub directory:
NOTE: The ‘*’ is a bash wildcard character that represents all entries in a directory. The ‘! .gitignore’ tells git to not ignore the .gitignore file; since we are ignoring all files in this directory.
Additional information for git ignore: gitignore documentation
No Comments