├── .gitattributes ├── .gitignore ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Unreal Engine file types. 2 | *.uasset filter=lfs diff=lfs merge=lfs -text 3 | *.umap filter=lfs diff=lfs merge=lfs -text 4 | 5 | # Raw Content file types. 6 | *.3ds filter=lfs diff=lfs merge=lfs -text 7 | *.bmp filter=lfs diff=lfs merge=lfs -text 8 | *.exr filter=lfs diff=lfs merge=lfs -text 9 | *.fbx filter=lfs diff=lfs merge=lfs -text 10 | *.jpeg filter=lfs diff=lfs merge=lfs -text 11 | *.jpg filter=lfs diff=lfs merge=lfs -text 12 | *.mov filter=lfs diff=lfs merge=lfs -text 13 | *.mp3 filter=lfs diff=lfs merge=lfs -text 14 | *.mp4 filter=lfs diff=lfs merge=lfs -text 15 | *.obj filter=lfs diff=lfs merge=lfs -text 16 | *.ogg filter=lfs diff=lfs merge=lfs -text 17 | *.png filter=lfs diff=lfs merge=lfs -text 18 | *.psd filter=lfs diff=lfs merge=lfs -text 19 | *.tga filter=lfs diff=lfs merge=lfs -text 20 | *.wav filter=lfs diff=lfs merge=lfs -text 21 | *.xcf filter=lfs diff=lfs merge=lfs -text 22 | 23 | # Anything in `/RawContent` dir. 24 | /RawContent/**/* filter=lfs diff=lfs merge=lfs -text 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore all files by default, but scan all directories. 2 | * 3 | !*/ 4 | 5 | # Do not ignore git files in the root of the repo. 6 | !/.git* 7 | 8 | # Do not ignore current project's `.uproject`. 9 | !/*.uproject 10 | 11 | # Do not ignore source, config and plugins dirs. 12 | !/Source/** 13 | !/Config/** 14 | !/Plugins/** 15 | 16 | # Only allow .uasset and .umap files from /Content dir. 17 | # They're tracked by git-lfs, don't forget to track other 18 | # files if adding them here. 19 | !/Content/**/*.uasset 20 | !/Content/**/*.umap 21 | 22 | # Allow any files from /RawContent dir. 23 | # Any file in /RawContent dir will be managed by git lfs. 24 | !/RawContent/**/* 25 | 26 | # OS/platform generated files. 27 | 28 | # Windows 29 | ehthumbs.db 30 | Thumbs.db 31 | 32 | # Mac OS X 33 | .DS_Store 34 | .DS_Store? 35 | .AppleDouble 36 | .LSOverride 37 | ._* 38 | 39 | # Linux 40 | *~ 41 | .directory 42 | 43 | # vim 44 | [._]*.s[a-w][a-z] 45 | [._]s[a-w][a-z] 46 | *.un~ 47 | Session.vim 48 | .netrwhist 49 | 50 | # Visual Studio 51 | .vs 52 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 MOZGIII 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ue5-gitignore 2 | 3 | A correct `git` setup example _with [`git-lfs`](https://git-lfs.github.com/)_ for Unreal Engine 5 (and 4) projects. 4 | 5 | ## Version Management Design and Conventions 6 | 7 | This template implies some conventions to be used correctly, which are discussed below. You should be able copy and paste them into your project's `README.md` if you want to. 8 | 9 | > If you are using `git` with Unreal Engine, you might want to also 10 | > enable [One File Per Actor](https://docs.unrealengine.com/5.0/en-US/one-file-per-actor-in-unreal-engine/) 11 | > feature, as it provides a more atomic level versioning flow. 12 | 13 | ### Repo Structure 14 | 15 | Repository structure is fixed, and it only has a few toplevel directories. Every other directory or file is ignored. 16 | 17 | - `/Source` 18 | - `/Config` 19 | - `/Plugins` 20 | - `/Content` 21 | - `/RawContent` 22 | 23 | `git-lfs` management rules are mostly defined for file types, and not _paths_, however there can entire paths marked to be managed by `git-lfs`. Without a special note, expect only type-based rules apply to a directory. 24 | 25 | #### `/Source` 26 | 27 | C++ source code is stored under the `/Source` path. As with most other directories, this directory is managed by standard git (and not `git-lfs`). That means no blobs. Do not put here any `.dll`s, `.exe`s, `.zip`s and other binaries. Only text files are allowed. 28 | Generated text files can reside in the local `/Source` dir, but should be ignored by git with additional entries in `.gitignore`. 29 | 30 | #### `/Config` 31 | 32 | Engine and game config files. 33 | 34 | #### `/Plugins` 35 | 36 | Game plugins. Every plugin lives in a subdirectory of the `/Plugins` dir. A plugin internal directory structure is not strictly documented, so there are no assumptions on how a plugin is structured. 37 | It may be useful to use git submodules to manage plugins in a more robust manner. 38 | It is expected that each plugin will have it's own `.gitignore` file in it's subdirectory, as well other required specific git tweaks. 39 | 40 | #### `/Content` 41 | 42 | Game assets in Unreal Engine formats, `.uasset` and `.umap`. Only those two file types are allowed, everything else is ignored. 43 | 44 | #### `/RawContent` 45 | 46 | **This directory is managed entirely by `git-lfs`.** 47 | 48 | `/RawContent` is a directory where you store assets in their source formats, in contrast to `/Content`, where assets are stored in the engine format (after the import). Having an asset in a source format is useful when you're still making updates to it. It may be a good idea to also have separate repos for managing work-in-progress assets (maybe in smaller collections or even idividually). 49 | 50 | ## How to use 51 | 52 | 1. Set up `git` and `git-lfs`. 53 | 2. Copy `.gitignore` and `.gitattributes` to your project. 54 | 55 | ## Caveats 56 | 57 | Take special care when working with plugins. Plugin structure is not very well defined, so you will be able to mess the git repo up with big files if you commit them to a plugin directory. 58 | 59 | ## Contributing 60 | 61 | ### Rules 62 | 63 | This repo uses UNIX-style line endings and UTF-8. 64 | Make sure every line in a text file is ended with a newline (especially the last line in a file, git should notify you if you've lost it). This is due to how lines are [defined](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206). Feel free to search the web for more info on why to end every file with an "empty line". 65 | 66 | ### How to contribute 67 | 68 | 1. Fork it 69 | 2. Create your feature branch (`git checkout -b my-new-feature`) 70 | 3. Commit your changes (`git commit -am 'Add some feature'`) 71 | 4. Push to the branch (`git push origin my-new-feature`) 72 | 5. Create new Pull Request 73 | --------------------------------------------------------------------------------