Skip to content

Instantly share code, notes, and snippets.

@anitsh
Last active April 13, 2020 17:28
Show Gist options
  • Save anitsh/18f8e0b30388ce813f63abcb3fb3ee08 to your computer and use it in GitHub Desktop.
Save anitsh/18f8e0b30388ce813f63abcb3fb3ee08 to your computer and use it in GitHub Desktop.
Git

This gist will be about git.

Why:

  • .gitignore file only works well with items that are common for all.
  • switching branches might screw things up.

Solutions:

  • .git/info/exclude for per-project
  • ~/.config/git/ignore per-user

Example:

  • git ls-files --others --exclude-from=.git/info/exclude --others Tells the command to show files that are not in the index. --exclude-from Is a filter to not show files from its parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment