-
Install Git: https://git-scm.com/
-
Install Git Large File Storage: https://git-lfs.github.com/
-
Create a Github account: https://github.com/
-
Install the Github desktop app (not required if using command line): https://desktop.github.com/
-
Create a new Github repo on Github website and add the Unity .gitignore template
-
Clone the new repo on local machine via File > Clone repository in Github desktop app
-
Navigate to the local repo directory in Windows File Explorer, right click inside the directory, and select: Open Git Bash Here
-
In the Git Bash command window, tell Git you want to use Git LFS by entering:
git lfs install
-
In the Git Bash command window, initialize a new .gitattributes file by entering:
git lfs track “*.psd”
-
Create a new Unity project in the same local repo directory
-
Open Project Settings in Unity and make sure Editor > Asset Serialization Mode is set to Force Text
-
Move the .gitignore file into the Unity project subdirectory
-
Replace contents of the .gitattributes file with this:
## Unity ## *.cs diff=csharp text *.cginc text *.shader text *.mat merge=unityyamlmerge eol=lf *.anim merge=unityyamlmerge eol=lf *.unity merge=unityyamlmerge eol=lf *.prefab merge=unityyamlmerge eol=lf *.physicsMaterial2D merge=unityyamlmerge eol=lf *.physicMaterial merge=unityyamlmerge eol=lf *.asset merge=unityyamlmerge eol=lf *.meta merge=unityyamlmerge eol=lf *.controller merge=unityyamlmerge eol=lf ## git-lfs ## #Image *.jpg filter=lfs diff=lfs merge=lfs -text *.jpeg filter=lfs diff=lfs merge=lfs -text *.png filter=lfs diff=lfs merge=lfs -text *.gif filter=lfs diff=lfs merge=lfs -text *.psd filter=lfs diff=lfs merge=lfs -text *.ai filter=lfs diff=lfs merge=lfs -text *.tif filter=lfs diff=lfs merge=lfs -text #Audio *.mp3 filter=lfs diff=lfs merge=lfs -text *.wav filter=lfs diff=lfs merge=lfs -text *.ogg filter=lfs diff=lfs merge=lfs -text #Video *.mp4 filter=lfs diff=lfs merge=lfs -text *.mov filter=lfs diff=lfs merge=lfs -text #3D Object *.FBX filter=lfs diff=lfs merge=lfs -text *.fbx filter=lfs diff=lfs merge=lfs -text *.blend filter=lfs diff=lfs merge=lfs -text *.obj filter=lfs diff=lfs merge=lfs -text #ETC *.a filter=lfs diff=lfs merge=lfs -text *.exr filter=lfs diff=lfs merge=lfs -text *.tga filter=lfs diff=lfs merge=lfs -text *.pdf filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.dll filter=lfs diff=lfs merge=lfs -text *.unitypackage filter=lfs diff=lfs merge=lfs -text *.aif filter=lfs diff=lfs merge=lfs -text *.ttf filter=lfs diff=lfs merge=lfs -text *.rns filter=lfs diff=lfs merge=lfs -text *.reason filter=lfs diff=lfs merge=lfs -text *.lxo filter=lfs diff=lfs merge=lfs -text
-
In the Github desktop app, type
Initial commit
in the Summary field and click the Commit to main button -
In the Git Bash command window, you can see the files that use Git LFS by entering:
git lfs ls-files
I got tired of watching this YouTube video and decided to capture the instructions here in case the video ceases to exist.