Dark1Git - A native unity git client

Hi!
I have been developing a native unity git plugin and i have just released it on the asset store.

Dark1Git on Asset Store

Features:

  • Intuitive interface
  • Standard staging + unstaging operations
  • Committing changes
  • Pull + push operations
  • Navigating through past commits (BUGGY! Avoid using for now)
  • Branching
  • Initiating and cloning repositories integrated (no integrated support for adding remotes yet)
  • ssh and https remotes

TODO:

  • Testing and bug fixing
  • Merging conflicts
  • Project window integration

Please don’t hesitate to report bugs or request features here or at contact@dark-1.com

Have a nice day!

It doesn’t seem to work on Mac OS.

I get:
InvalidOperationException: Process has not been started.
System.Diagnostics.Process.get_HasExited ()
(wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_HasExited ()
Dark1Git.Dark1Git.initProcess (System.String args, System.Diagnostics.DataReceivedEventHandler output, System.Diagnostics.DataReceivedEventHandler error) (at Assets/Editor/Dark1Git/Dark1Git.cs:179)
Dark1Git.Dark1Git.initProcess (System.String args) (at Assets/Editor/Dark1Git/Dark1Git.cs:174)
Dark1Git.Dark1Git.Init () (at Assets/Editor/Dark1Git/Dark1Git.cs:397)
Dark1Git.Dark1Git.OnGUI () (at Assets/Editor/Dark1Git/Dark1Git.cs:427)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

I added git/bin to the PATH

echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin

in case it couldn’t find the executable but it didn’t fix it.

Sorry, mac os hasn’t been tested yet, but adding that on top of my todo list. Expect an update within the next few days.

I just had a friend test this on his OSX 10.8.5 VM.
He said everything was working as expected.
This is his path variable
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin

Please make sure running git from the terminal app works, for example do “git --help”.

Please do post if you have more problems.

Git works from terminal, I use it a lot :smile:.

Does your friend have UnityPro? I am wondering if the command cannot be executed from Unity Free.

I installed and messed with dark1git on mac yesterday, using mac os x mavericks and unity free. Everything worked as expected. I have Xcode 5 installed and git comes with the command line tools.
This is my path variable:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Basically, the git commands are executed directly, like in the terminal, so if you can run git from the terminal, it should be ok. Try updating dark1git if you don’t have the latest version and do things according to the readme.

Maybe try logging the StartInfo.FIleName in Dark1Git.cs on line 187?

Thanks.

			Process newProcess = new Process();
			#if UNITY_EDITOR_WIN
			newProcess.StartInfo.FileName = path+"\\PortableGit\\cmd\\git.exe";
			#else
			newProcess.StartInfo.FileName = "git";
			#endif

			UnityEngine.Debug.Log("filename "+newProcess.StartInfo.FileName);

the log is:
filename git

I downloaded the latest version and it does have more logging, there is an exception on line 206

			try{
				newProcess.Start();
			}
			catch(System.Exception e){
				UnityEngine.Debug.Log (e.Message);
			}

The exception log is: ApplicationName=‘git’, CommandLine=‘init’, CurrentDirectory=‘’

Not sure it helps.

That doesn’t seem very useful. Please tell me the way things are configured on your mac and i’ll try to reproduce it. (OSX version, Xcode version, how was git installed etc)

Hello all right?

I’m quite interested in the plugin, but I have a feedback. I’m working with two other people who have no knowledge of versioning, coding, etc …
For a while we used Perforce, along with P4Connect plugin, but keep the Perforce was getting expensive then migrated to git.
The problem we had is that the P4Connect interface was simple and intuitive, the icon itself of the asset in Unity, already showed the status of the file, which files would that revision, etc …
Do you have plans to add this integration (show status icon in itself) in some future update? I believe the P4Connect interface would be a good reference.

Thank you, and I intend to this weekend, buy the plugin, successes.

I had no idea that is possible, but i’ll look into it, seems like an awesome feature to have.

How is this coming along?

I had very little time on my hands the past few months, i’ll get back to working on this at the end of the summer.

Hi;
Ive just picked this up to try as an in-Unity alternative to TortoiseGIT. I already have Git for Windows installed, as well as TortoiseGit, and it seemed a bit inconvenient to me to have to have PortableGit executables inside the Assets folder (and PortableGit seems to be deprecated?), so Ive modified it slightly to use a user-configurable Git binary location and Bash startup script Preferences , as well as adding a proper Preferences panel for setting those paths, as well as URL, username and password.
Im wondering if this might be useful for anyone else, and if so, what the etiquette would be regarding ‘publically’ modifying a paid-for Asset. Would it be permissable to post the code modifications here, or would it the author have an issue with that sort of thing? They’re pretty trivial TBH, Im fairly new to Unity, but they might be of use?

Since we’re talking about Git, posting a patch file seems reasonable to me in this situation.

Good job on the modification, it sounds great.

It struck me that it might be useful to load and save the URL/username/password settings (the URL at least would presumably vary on a project by project basis), particularly in my own case where Im doing lots of little ‘learning’ projects, so Im going to add that in to the preference panel. If there’s no objection from the original author by the time Ive done that I’ll post the modifications here once ive done that.

@sxa Thanks for your contribution, sharing patch files is reasonable.
I’ll also make sure to include your name in the contributors list i’ll add on the top of the main plugin file, in the next official release.
Thanks.

Okay, I think this is finally ready to share.

This adds a preferences panel for Dark1Git, accessible from Edit>Preferences, with the following control

  • Preferences for the git account information ie

  • URL, username and protected password field

  • Saving and loading of the git account settings to/from a file, allowing different settings for different projects

  • Customisation of the path for git and bash (probably unnecessary for OSX)

Some code changes to dark1git.cs were necessary to get this working. They should do touch any of the functionality of dark1git.cs, they just add mechanisms to use the settings or sync changes made in the control panel. All changes to the code are clearly highlighted with a comment.

Everything is here:

https://docs.google.com/file/d/0BzdNjCWbtS21OUpLcS1xX1N2ekE

This is a link to a zipfile containing three files. One file is the code for the preferences panel itself (dark1gitprefs.cs), and just drops straight in to the same folder as dark1git.cs etc.

the second file is a diff file (dark1git.diff) which will modify dark1git.cs to integrate the changes

The third file is a windows batch file (applyDiffFile.bat) which uses patch to apply the diff file to the existing copy of dark1git.cs, creating a version called dark1git_modded.cs. The implementation of git/diff/patch I used was Git For Windows from http://git-scm.com/ You’ll need to modify this .bat file with the path to your own git directory, or you may prefer to apply the patch manually.

The patched version of the file (ie dark1git_modded.cs) will need to be renamed to dark1git.cs to replace the original dark1git.cs file, they can’t coexist .

This has been all been done on a Windows system under unity 4.5, and has not been tested on OSX, but there’s very little that should be platform dependent. As I say, Ive tried not to affect the core dark1git code, but please let me know if you have any issues.

This project seems dead,
No updates for a year :frowning:

Any decent actively maintained unity git plugin?

We will be releasing an updated version with more features very soon.

How long? Will it work with Unity 5?