Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git ignore

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage
opp.js

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Comment

How to ignore files in git

Then in Git Bash you have to write the following line:

git config --global core.excludesfile ~/.gitignore_global
--------------------------------------------------------------------
If the repository already exists then you have to do the following:

git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
If the step 2 doesn’t work then you should write the whole route of the files that you would like to add.
Comment

ignore file git

$ echo debug.log >> .gitignore
$ git rm --cached debug.log
rm 'debug.log'
$ git commit -m "Start ignoring debug.log"
Comment

git ignore files

just put the name or the path to your file in a .gitignore file, like this:

your_file.svg     <-- ignore the file your_file.svg
*.sql             <-- ignore any .sql files
ihm/test/         <-- ignore the whole "test" folder in "ihm"
Comment

.gitignore file

# Created by https://www.toptal.com/developers/gitignore/api/macos,intellij,java
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,intellij,java

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn.  Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/

# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two 
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# End of https://www.toptal.com/developers/gitignore/api/macos,intellij,java
Comment

how to git ignore

git reset name_of_file
Comment

PREVIOUS NEXT
Code Example
Shell :: force remove a hidden folder in linux 
Shell :: run command as root administrator mac 
Shell :: tar exclude multiple directories 
Shell :: shell curl extract bearer token from response 
Shell :: install yarn on ubuntu 
Shell :: push to github from terminal 
Shell :: helm docker generate doc 
Shell :: publish website locally 
Shell :: git stash save 
Shell :: pyenv install latest version 
Shell :: delete all files in a directory command 
Shell :: pushing existing project to github 
Shell :: how to stash specific file in git 
Shell :: how to install specific package version npm 
Shell :: net speed monitor for ubuntu 
Shell :: patch: command not found 
Shell :: rsync ssh 
Shell :: install google chrome fedora 
Shell :: displaying the last line of output bash 
Shell :: a new powershell stable release is available 
Shell :: docker start container 
Shell :: batch file if statement 
Shell :: proxy_connect_timeout nginx ingress 
Shell :: install rider ubuntu 
Shell :: how to update application in ubunut 
Shell :: open current directory 
Shell :: git update .gitignore 
Shell :: git clone private repo 
Shell :: how to add remote branch 
Shell :: execute c# ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =