Skip to content

Instantly share code, notes, and snippets.

@gamefish
Created June 4, 2022 16:27
Show Gist options
  • Save gamefish/88ab4ea6d317a667b72645a728bace34 to your computer and use it in GitHub Desktop.
Save gamefish/88ab4ea6d317a667b72645a728bace34 to your computer and use it in GitHub Desktop.
Create git repository mac script, also create git ignore file .gitattributes, and track large files using Git LFS
#!/bin/bash
## call git init
git init
## make .gitignore
cat > .gitignore << EOF
# old school
.svn
# Mac OS X
*.DS_Store
profile
# Ignore thumbnails created by windows
Thumbs.db
# This .gitignore file should be placed at the root of your Unity project directory
#
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
#
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/
# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
/[Mm]emoryCaptures/
# Recordings can get excessive in size
/[Rr]ecordings/
# Uncomment this line if you wish to ignore the asset store tools plugin
# /[Aa]ssets/AssetStoreTools*
# Autogenerated Jetbrains Rider plugin
/[Aa]ssets/Plugins/Editor/JetBrains*
# Visual Studio cache directory
.vs/
# Gradle cache directory
.gradle/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db
# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta
# Unity3D generated file on crash reports
sysinfo.txt
# Builds
*.apk
*.aab
*.unitypackage
*.app
# Crashlytics generated file
crashlytics-build.properties
# Packed Addressables
/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*
# Temporary auto-generated Android Assets
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*
# google firebase remote config downloaded data file
remote_config_data
EOF
## make .gitattributes
cat > .gitattributes << EOF
*.pbxproj -crlf -diff -merge
EOF
## add .gitignore and gitattributes to git list
git add .gitignore
git add .gitattributes -f
## using git large file storage to track large files
## https://git-lfs.github.com/
git lfs track "*.psd"
git lfs track "*.aar"
git lfs track "*.a"
## add git commit
git commit -m "Git Init for Unity!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment