Folders

How to open .GITIGNORE files (project dotfiles) on Android, Windows and Linux

What .gitignore, .htaccess, .npmrc, .lock and .patch files are, and how to open, read and edit these dotfiles for free on Android, Windows and Linux.

Cover: Folders' text editor on two phones, labelled .GITIGNORE

You copied a project to your phone, or unzipped someone’s code on a laptop, and found a file called .gitignore with nothing before the dot. Windows asks which app should open it. On Linux, and in many Android file managers, you may not see it at all, because a name that starts with a dot means “hidden”.

The answer is simpler than the name suggests: .gitignore and the other project dotfiles are plain text. Folders opens them in its built-in text editor on Android, Windows and Linux, where you can read, search, edit and save them.

What is a .gitignore file?

A .gitignore file tells Git which files to leave out of version control: build output, node_modules, logs and secrets such as .env. Each line is a pattern. # starts a comment, * matches anything, a trailing / means “only folders”, and ! brings back something an earlier line excluded. Each .gitignore applies to its own folder and everything below it.

The leading dot is an old Unix habit for files you don’t need to see every day, and .gitignore rarely travels alone. Most code projects carry a small family of dotfiles and machine-written files:

Extension What it is Where you meet it
.gitignore Patterns of files Git should not track Almost every Git repository
.gitattributes Per-path rules for Git: line endings, diffs, Git LFS for large files Projects shared between Windows and Linux
.editorconfig Indentation, character set and line-ending rules for code editors Shared projects
.npmrc npm settings, such as the package registry, and sometimes a login token JavaScript projects, your home folder
.babelrc Settings for Babel, the JavaScript compiler, as JSON Older JavaScript and React projects
.eslintrc Rules for the ESLint checker, in JSON or YAML JavaScript projects (newer ESLint uses eslint.config.js)
.prettierrc Options for the Prettier code formatter Front-end projects
.htaccess Per-folder settings for the Apache web server: redirects, rewrites, passwords Websites on shared hosting
.lock A lockfile pinning exact package versions, or an empty “in use” marker yarn.lock, Cargo.lock, composer.lock, Gemfile.lock
.pbxproj The project file of an Xcode project, in an old property-list syntax Inside the .xcodeproj folder of iPhone app projects
.diff, .patch A list of changes between two versions of some files Code reviews, mailing lists, git format-patch

How to open a .gitignore file with Folders

On Android:

  1. Install Folders from the download page and allow access to your files.
  2. Folders lists hidden files on phones from the start, so .gitignore shows up like any other file. (If you switched that off, turn Show hidden files back on in Options.)
  3. Go to the project folder, or search for the file name, and tap the file. It opens in the text editor.
  4. If it’s attached to an email or a chat message, tap it there and choose Open with → Folders.

On Windows and Linux:

  1. Browse to the project folder in Folders.
  2. On computers Folders hides dotfiles at first, like other file managers. Open Options and turn on Show hidden files.
  3. Double-click the file.

Windows’ File Explorer shows dotfiles anyway, as Windows hides files by an attribute rather than by a leading dot. The Folders installer adds Folders to Open with for these types, so you can also right-click the file → Open with → Folders.

Folders knows .gitignore, .gitattributes, .editorconfig and .npmrc by name. For others, such as .htaccess, it checks that the file is text and opens the same editor.

What you can do with it in Folders

  • Read it with line numbers, word wrap and adjustable text size.
  • Find, or Find and replace (with Match case) to rename a folder in every rule at once, and Go to line when a tool reports an error on line 14.
  • Edit and Save. Saving keeps the file’s encoding and line endings, so Git doesn’t see every line as changed.
  • Document info shows the encoding and the line endings (LF or CRLF): the first thing to check when a line-ending rule in .gitattributes or .editorconfig seems ignored.
  • Read a patch at a glance. In .diff and .patch files, added lines, removed lines and @@ headers have their own colours.
  • Open several files as tabs, or a file in hex viewer to spot invisible characters.

Folders only shows and edits text. It never runs Git, npm or a web server, so nothing in your project changes until you press Save.

Other ways to open .gitignore files

  • VS Code (free, Windows and Linux) colours all of these formats.
  • Notepad on Windows, or gedit, Kate or nano on Linux.
  • Your web host’s file manager, or nano over SSH, for .htaccess on a server.
  • GitHub and GitLab show every dotfile of a repository in the browser.

Problems opening a .gitignore file?

  • You can’t see the file. It’s hidden, not missing. Turn on Show hidden files in Folders’ Options; in Linux file managers, Ctrl+H usually does the same.
  • Your .gitignore “doesn’t work”. Git only ignores files it isn’t already tracking. Remove a file committed earlier with git rm --cached <file> and commit again.
  • Your site shows “500 Internal Server Error” after editing .htaccess. A typo, or a directive for an Apache module that isn’t enabled, breaks the folder. Keep a copy before editing and check your host’s error log. An invisible byte-order mark at the start can cause it too: Document info shows “UTF-8 BOM”, and Notepad++ or VS Code can save the file without one.
  • A .lock file is empty. Then it’s a marker that a program is using something, not a lockfile. Leave it while that program runs.

Questions people ask

Can I open a .gitignore file on Android? Yes. Folders shows hidden files on phones by default and opens .gitignore in its text editor, where you can edit and save it.

Should I edit a .lock file by hand? No. Let the package manager rewrite it (npm install, cargo update, composer update). Reading it shows exactly which package versions a project uses.

What’s the difference between a .diff and a .patch file? Usually none: both hold a unified diff. A .patch from git format-patch adds email-style headers (author, date, message) so git am can apply it with credit.

Is a .npmrc file safe to share? Not if it has a line with _authToken: that token works like a password for your npm account. Check before you commit or send it.

Working with other config formats? See how to open YAML and TOML files and how to open INI, CFG and .env files, or browse all 382 file types Folders opens.

Keep reading