Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to use gitignore to ignore a folder

You can ignore entire directories, just by including their paths and putting a / on the end:

1
2
node_modules/
logs/
Comment

gitignore folder

in .gitignore:
	folder/
Comment

gitignore exclude folder

# Ignore all directories, and all sub-directories, and it's contents:
*/*

#Now ignore all files in the current directory 
#(This fails to ignore files without a ".", for example 
#'file.txt' works, but 
#'file' doesn't):
*.*

#Only Include these specific directories and subdirectories:
!wordpress/
!wordpress/*/
!wordpress/*/wp-content/
!wordpress/*/wp-content/themes/
!wordpress/*/wp-content/themes/*
!wordpress/*/wp-content/themes/*/*
!wordpress/*/wp-content/themes/*/*/*
!wordpress/*/wp-content/themes/*/*/*/*
!wordpress/*/wp-content/themes/*/*/*/*/*
Comment

where should gitignore file be

Put .gitignore in the working directory. It doesn't work if you put it in the .git (repository) directory
$ ls -1d .git*
.git
.gitignore
Comment

how to make .gitignore

# Open git bash in the directory you wanna create .gitignore
# run command:
$ touch .gitignore
# there you go
Comment

how to setup a gitignore

### 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
Comment

PREVIOUS NEXT
Code Example
Shell :: tar command 
Shell :: git compare two branches 
Shell :: count new lines bash 
Shell :: src refspec master does not match any 
Shell :: tail last 100 lines 
Shell :: open current dir cmd 
Shell :: flatpak repo 
Shell :: How to list manually installed packages in ubuntu 
Shell :: how to delete files from command line 
Shell :: git branch from current branch 
Shell :: ssh permission denied publickey 
Shell :: rstudio find out if package is installed 
Shell :: The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER 
Shell :: how to give full permission to another user linux 
Shell :: linux list all system groups in order 
Shell :: How to solve bad signature... index file corrupt 
Shell :: git reset in gitlab 
Shell :: how to view hidden files in mac terminal 
Shell :: limits.h: No such file or directory 
Shell :: while bash one line 
Shell :: pull changes from different branch 
Shell :: torch 1.1.0 install 
Shell :: bash switch 
Shell :: push git repo to github 
Shell :: how to delete a folder in github 
Shell :: create empty file command prompt cmd 
Shell :: grep if 
Shell :: node ffmpeg 
Shell :: open folder 
Shell :: git update .gitignore 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =