Skip to content

Instantly share code, notes, and snippets.

@ashx3s
Last active October 22, 2021 03:53
Show Gist options
  • Save ashx3s/55f2f92d520dc40de4a5129cfd70e26c to your computer and use it in GitHub Desktop.
Save ashx3s/55f2f92d520dc40de4a5129cfd70e26c to your computer and use it in GitHub Desktop.
local gitignore

gitignore files

You can create project specific gitignore files in your git repo, and you can also create a global gitignore.

It is considered best practice to put system related files into a global gitignore.

  • A gitignore file sits in either the root of your git repo or in your home directory.
  • It needs to be pushed to the remote repositoy
  • it needs to be named `.gitignore

These are common files that you should exclude from your projects.

#Mac
.DS_Store
.Spotlight-V100
.Trashes

# Windows
Thumbs.db
desktop.ini

# vi
*~

# vscode
.vscode

# General
log/
*.log

Node specific

  • You must include these in your gitignore for your cpnt261 assignments.
.env
.env.test

node_modules/
    ```

How to create a global gitignore

  • In your home directory create .gitignore_gobal
  • add files that you want to exclude from all your projects in that file
  • If you're on Linux or mac, run the command: git config --global core.excludesfile ~/.gitignore_global
  • If your on windows, your command will look more like git config --global core.excludesfile %USERPROFILE%\.gitignore_global
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment