Awesome
GitNity - Git for Unity
<img src="./.github/GitNity-repo-card.png"> <br> <br>Git integration for Unity projects, all basic tools inside the editor
Github Repository: https://github.com/meaf75/GitNity
⚠ Plugin under development: I'm still working on this project :construction_worker: so be careful using it on larger projects and feel free to contribute it 🚧🚧
<div class="page-break"></div>
Features
Unchecked means To Do
- List changes (Modified, untracked, new, merge error)
- Commit files by selecting them
- Push pending commits
- Fetch changes
- Pull changes
- Create & switch branch
- Display git commits, filter by branch
- Context Menu on right click on an asset
- Generate .gitignore
- Draw status icon on files with modifications or tracked by git
- Private ssh key support
- Draw icon for ignored files/folders
- Merge tool or open X file with the script editor assigned in preferences
- LSF support
- Git Stash & Git stash pop/apply
Table of content
Requirements
- You must have the git command line tools registered in your system path, you can install it at https://git-scm.com/download.
- Unity 2021.3.x
Installation
From a git url
You can install this plugin via assets manager from a git url
More information at: https://docs.unity3d.com/Manual/upm-ui-giturl.html
https://github.com/meaf75/GitNity.git?path=/Assets/Plugins/GitNity
From this repo
Copy the content of this repository located at Assets/Plugins inside a folder in your unity project located at the same route
<div class="page-break"></div>Instructions
Configuration
-
All windows are located under Tools/GitNity.
-
Configuration window allows you setup repository information (Tools/GitNity/GitNity Config).
-
Make sure your project is a git repository if not then you can initialize your project from the config window (Tools/GitNity/GitNity Config).
-
You can also set a ssh key path to authenticate with your private repository by setting the private ssh key path.
GitNity window
-
First you will need to select the files you want to commit, you can do it by selecting the files in the GitNity window (Tools/GitNity/GitNity Window), add a commit message and add a commit message, finally you have to click the "Commit selected" button, this action will add selected items and commit them.
-
After commit your files the final step is push your commit, when you have commits without push a "push" button will apear next to the "Commit selected" button, click it to push your pending commits, this action will make the selected files to disappear from the list don't worry they are staged with the new commit.
-
Icons will be drawn over the project assets to represent their git status inside unity
Status Icon Deleted <img src="https://github.com/Zxynine/UnityEditorIcons/raw/main/icons/small/processed/d_CollabDeleted%20Icon.png" width="40"/> Modified <img src="https://github.com/Zxynine/UnityEditorIcons/raw/main/icons/small/processed/d_CollabEdit%20Icon.png" width="40"/> Type changed <img src="https://github.com/Zxynine/UnityEditorIcons/raw/main/icons/small/processed/d_CollabMoved%20Icon.png" width="40"/> Renamed <img src="https://github.com/Zxynine/UnityEditorIcons/raw/main/icons/small/processed/d_CollabMoved%20Icon.png" width="40"/> Copied <img src="https://github.com/Zxynine/UnityEditorIcons/raw/main/icons/small/processed/d_CollabMoved%20Icon.png" width="40"/> New <img src="https://github.com/Zxynine/UnityEditorIcons/raw/main/icons/small/processed/d_CollabCreate%20Icon.png" width="40"/> Unknown <img src="https://github.com/Zxynine/UnityEditorIcons/raw/main/icons/small/processed/d_CollabCreate%20Icon.png" width="40"/> Ignored <img src="https://github.com/Zxynine/UnityEditorIcons/raw/main/icons/small/processed/CollabExclude%20Icon.png" width="40"/> -
Context menu, if you right click over a element in the list of tracked files a pop up will appear with some useful actions
Branching
-
branching, you can switch between git branches by clicking over the drop down at the top right corner of the GitNity window, all tracked branches will be displayed as value in the dropdown menu
-
you can also create a new branch by selecting "New branch..." option in the branch dropdown.
this action will make apear a window where you can set the information for the new branch
Commits tab
-
You can list the commits made in a specific branch by selecting the "Commits" tab in the GitNity window
Diff window
-
You can see the changes that you made from a specific file by right clicking over a file in the ListView and selecting "View changes"
This action will open a window to display all the changes for the selected file
Git commands used
You can find a full list of all the git commands used on this project at README_GIT_COMMANDS.md