Articles → GIT → .Gitignore File In Git

.Gitignore File In Git






What Is .Gitignore File?





How To Create .Gitignore File?




Touch .gitignore



Prerequisite Of .Gitignore




  1. Clear the cache using the following command.
  2. git rm -r --cached .


  3. Commit .gitignore file
  4. Git add .
    Git commit *.* –m “Committing .gitignore file”



How To Ignore File?




  1. Open .gitignore file in notepad.
  2. Add the following code
# ignore log file
log.txt






Picture showing the file ignored by .gitignore file
Click to Enlarge


How To Ignore Folders?




# ignore log file
log.txt

#ignore directory
MyFolder/*





Posted By  -  Karan Gupta
 
Posted On  -  Thursday, July 25, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250