User Tools

Site Tools


git

This is an old revision of the document!


Git

.gitignore

The .gitignore file tells git which files you do not want included when you upload to your repository. For example fiels with personal info, or just things irrelevant to other people who may contribute.

They can live multiple places, so you can exlude things globably, or per-project.

Windows

It's a little bit fiddly to make dot files on windows, but you can do so from the command prompt. Either:

  • NUL> .gitignore to create a new file.
  • REN [existing file] .gitignore to rename a file you've already made.

To open a command prompt at your current location in Windows Explorer enter cmd in the location bar and hit Enter. You can jump there quickly with either F4 or Alt+D

Examples

Specific useful things to ignore

So for Unity game you probably want to ignore those .pdb files.

#	Visual Studio / Unity
*.pdb

#	Temp files
*~

If you want to, as a base, ignore everything, then specifically tell it what to not-ignore:

#	ignores everything
/*
#	except for...
!/directory
!file
git.1604097101.txt.gz · Last modified: 2020/10/31 09:31 by rjt