xxxxxxxxxx
# Open git bash in the directory you wanna create .gitignore
# run command:
$ touch .gitignore
# there you go
xxxxxxxxxx
#Linux
$ touch .gitignore
#Windows
cd c:\<your path>
notepad .gitignore
#Accept the prompt to create the file, edit the contents accordingly, save and close.
xxxxxxxxxx
# Ignore files with .txt extension
*.txt
# Ignore the 'build' directory
/build
# Ignore a specific file
my_file.txt
# Ignore all files in any directory named 'temp'
**/temp/
xxxxxxxxxx
You can ignore entire directories, just by including their paths and putting a / on the end:
1
2
node_modules/
logs/
xxxxxxxxxx
# Ignore files/folders starting with a dot
.*
# Ignore build output files
/build
# Ignore log files
*.log
# Ignore IDE-specific files
.idea/
.vscode/
# Ignore compiled files
*.class
*.jar
*.war
# Ignore sensitive or configuration files
config.ini
credentials.secret
xxxxxxxxxx
echo "function gi() { curl -L -s https://www.gitignore.io/api/\$@ ;}" >> ~/.bash_profile && source ~/.bash_profile
xxxxxxxxxx
### Terraform ###
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
# Crash log files
crash.log
# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.tfvars
# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json
# Include override files you do wish to add to version control using negated pattern
# !example_override.tf
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
# End of https://www.toptal.com/developers/gitignore/api/terraform