Skip to content

Instantly share code, notes, and snippets.

@michel-zimmer
Last active July 25, 2016 10:12
Show Gist options
  • Save michel-zimmer/98b6fa8f026573c0db70ff5ece4b5b9f to your computer and use it in GitHub Desktop.
Save michel-zimmer/98b6fa8f026573c0db70ff5ece4b5b9f to your computer and use it in GitHub Desktop.
How to use GitHub to host Unity repositories
#==Unity
#==Global/MonoDevelop
#==Global/Linux
#==Global/OSX
#==Global/Windows
# Auto detect text files and perform LF normalization
* text=auto
# Higher probability of success rates while merging C# files
*.cs diff=csharp
# Git LFS
*.assets filter=lfs diff=lfs merge=lfs -text
*.bmp filter=lfs diff=lfs merge=lfs -text
*.tiff filter=lfs diff=lfs merge=lfs -text
*.tif filter=lfs diff=lfs merge=lfs -text
*.tga filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text
*.tga filter=lfs diff=lfs merge=lfs -text
*.mp3 filter=lfs diff=lfs merge=lfs -text
*.ogg filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text
*.aiff filter=lfs diff=lfs merge=lfs -text
*.aif filter=lfs diff=lfs merge=lfs -text
*.mod filter=lfs diff=lfs merge=lfs -text
*.it filter=lfs diff=lfs merge=lfs -text
*.s3m filter=lfs diff=lfs merge=lfs -text
*.xm filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.mov filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
## https://raw.githubusercontent.com/github/gitignore/master/Unity.gitignore ##
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
# Unity3D generated meta files
*.pidb.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
# Builds
*.apk
*.unitypackage
## https://raw.githubusercontent.com/github/gitignore/master/Global/MonoDevelop.gitignore ##
#User Specific
*.userprefs
*.usertasks
#Mono Project Files
*.pidb
*.resources
test-results/
## https://raw.githubusercontent.com/github/gitignore/master/Global/Linux.gitignore ##
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
## https://raw.githubusercontent.com/github/gitignore/master/Global/OSX.gitignore ##
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
## https://raw.githubusercontent.com/github/gitignore/master/Global/Windows.gitignore ##
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk

How to use GitHub to host Unity repositories

Examples for .getignore, .gitigore and .gitattributes are atached.

Unity

From the main menu under Edit, Project Settings and then Editor set the Version Control Mode to Visible Meta Files and Asset Serialization Mode to Force Text.

.gitignore

Use the following templates from github.com/github/gitignore:

If it is not assured, that every project member has its Git installation configured to ignore operating system specific files, you might want to include these:

.gitattributes

Auto detect text files and perform LF normalization: * text=auto

Higher probability of success rates while merging C# files: *.cs text diff=csharp

Git LFS

Use Git Large File Storage and track the following files as a starting point:

  • .assets
  • .bmp
  • .tiff
  • .tif
  • .tga
  • .jpg
  • .jpeg
  • .png
  • .psd
  • .tga
  • .mp3
  • .ogg
  • .wav
  • .aiff
  • .aif
  • .mod
  • .it
  • .s3m
  • .xm
  • .mp4
  • .mov
  • .ttf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment