Git plugin v2 - godotengine/godot-git-plugin GitHub Wiki
- Install Git from https://www.git-scm.com/
- Configure your username and email in Git
$ git config --global user.name "your name"
$ git config --global user.email [email protected]
You can install this plugin from the Godot Asset Library here or you can use the manual process mentioned below.
-
Windows users should ensure they have the VC 2019 redistributable runtime installed.
-
MacOS users may need to perform a one-time workaround as described here to be able to load the plugin in Godot.
-
Extract the .zip contents under the
res://addons/
directory of your Godot project. Please ensure that the plugin does not get extracted insideres://addons/godot-git-plugin-vx.x.x/godot-git-plugin
, the plugin requires itself to be kept atres://addons/godot-git-plugin
. -
Open your project using the Godot Project manager.
When the project loads up, you are greeted with the Godot editor that you know and love. However, you now have the option to set up a VCS plugin from the editor.
- Open
Project
>Version Control
. SelectSet Up Version Control
.
- A popup will ask you which VCS plugin would you like to use. In our case we are using Git, so select
GitAPI
from the drop-down menu. Then clickInitialize
, and optionally enter your remote details to use the network features of this plugin, and then clickApply
. The.gitignore
and.gitattributes
files that this plugin will automatically create are picked up from here.
If you are not able to see a GitAPI
option then check if you copied the correct folder to res://addons/
according to the installation instructions.
Git plugin provides the Godot editor with the backend hooks to:
- View diffs for files and commits in Git. Both unified and split views are supported by the Godot editor.
- Stage and unstage files. Double click the file names to move them from the staged to the unstaged area or vice-versa.
- Commit changes to Git
- Branches, use multiple remotes and push/pull/fetch new changes to a Git remote (e.g. a Github repository) with HTTPS or SSH transport. Performing network operations may freeze the editor till the network operation is complete, so you can watch the console logs to view their progress.
- Commit history along with author and other metadata
Why isn't my remote password/SSH passphrase getting saved in the editor?
Currently, the Godot Editor will not save your passwords locally on disk to avoid exposing your passwords to malicious parties. All other remote login settings will be retained.
How to setup network features of this plugin?
After initializing the plugin, enter the remote login settings and hit Apply. You may want to ensure that your SSH public/private key files are having the appropriate permissions for this plugin to be able to load them in.
If you are using Github, HTTPS passwords will not work and they will need to be replaced with a Github PAT linked to your Github account. More information on creating a Github PAT is here.
Open the Commit tab and create a new remote with the SSH endpoint to your Git remote. It should look like the image below.
Note the [email protected]:<organization>/<repository>.git
format in the remote URL.
Now Godot should use your specified credentials while pushing new commits to this remote.