Ignoring directories in Git repos on Windows

Ignoring directories in Git repos on Windows

Asked on December 28, 2018 in Git.
Add Comment


  • 3 Answer(s)

    Create a file named .gitignore in your project’s guide. Ignore directories by entering the guide name into the file with a slash appended:

    dir_to_ignore/
    

    information   here

    Answered on December 28, 2018.
    Add Comment

     Windows explorer will show .gitignore when in-fact the file name is .gitignore.txt

    .gitignore.txt  is not use in git

    User may not able to rename the file to .gitignore because explorer thinks its a file of type gitignore with no name.

    Non command line solution:

    You can rename a file to ".gitignore." and it will create ".gitignore"
    
    Answered on December 28, 2018.
    Add Comment

    Ignoring files and directories there are two main ways are given below:

      1. .gitignore
    • Allocate .gitignore file into the root of your repo besides .git folder in Windows make sure you see the real file extent and then make .gitignore. with the point at the end to make empty file extension
    • Preparing  global configuration ~/.gitignore_global and operating  git config –global core.excludesfile ~/.gitignore_global to add this to your git config

     files tracked before can be untracked by operating git rm –cached filename

                              2.  Repo exclude – For local files no need to be shared,  just add the file pattern or directory to the file .git/info/exclude. These rules are not commited,  are not seen by other users 

    Answered on December 28, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.