unity-preview icon indicating copy to clipboard operation
unity-preview copied to clipboard

Github for Unity does not commit any files that are located into a folder Called Editor in the Root

Open kinifi opened this issue 9 years ago • 3 comments

Version: 5.6.0f3 to 5.0f1 Github For Windows Version: v0.9.1-alpha Platform: All versions of Unity from 5.0 on Windows, OSX, Linux

Severity:

Github for Unity is Unusable with any code that extends Unity, which includes the majority of the Unity Asset Store and all of a teams code that extends the Unity Editor via a root Editor folder.

Description:

The project cannot be used with most if not the majority of Unity Asset Store Plugins or your own code that contains an editor extension due to Github for Unity ignoring the all files/folders/assets inside of any folder called "Editor" because thats where Unity for Github is located.

The feature of unity having Editor Folders inside of other folders and not having to be in the Root Assets has existed for a long time. You can have multiple Editor folders inside of other folders. Please see our special folders documentation.

Special Folders Documentation

Solution 1: A more direct path needs to be associated with Github by moving the Github for Unity Plugin into a folder called Github. Github for Unity will ignore all files within the Github Folder.

Folder Structure:

Unity Project

  • Assets
    • Github
      • Editor (contains Github For Unity)
  • Project Settings

Solution 2: Do not restrict what Github for Unity commits in anyway. It does not matter if users commit Github for Unity to their repos. A lot of people move all their plugins to different folders so Solution 1 isn't perfect either.

kinifi avatar Apr 22 '17 00:04 kinifi

Could you give some more details on this? Did you add a file into the Editor folder and it didn't show up as a change in the Changes tab? What OS did this happen in?

One thing to note is that on OSX and Linux we don't yet have a reliable filesystem watcher in place. That means that the Changes, History and Branches tab might not immediately show changes - we're relying on the assets postprocessor for triggering refreshes.

As to where the extension is installed and what gets tracked:

The extension is installed into Assets/Editor/GitHub, and the .gitignore that's placed in the project root is is https://github.com/github/gitignore/blob/master/Unity.gitignore plus two extra entries to ignore where the extension is:

/Assets/Editor/GitHub.meta
/Assets/Editor/GitHub/

I just added a script to the Editor folder in a new project with 0.9.1-alpha setup, and this is what I get in the Changes tab (on Windows):

image

The extension doesn't restrict what can be committed in any way, it's all controlled via the configurations set in the .gitignore, so if something isn't showing up for you, it's either some failure to detect and refresh what got changed or some problem with our .gitignore.

shana avatar Apr 22 '17 09:04 shana

I've figured this out. This bug can be closed and I can open a new one.

Steps To Reproduce:

  1. Fresh install of the unity package
  2. Open the github window
  3. Init a new repo, then do not do your first commit.
  4. Select the Changes Tab, Observe the default files have not been committed.
  5. Add a new file in the Editor Folder
  6. Now try to Open the folder called "Github" inside Editor->Github.
  7. Observe, the entire editor will crash sometimes and the Github application has multiple different behaviors that are not intended.

Note: Drawing of the Project view is completely broke at this time.

error

kinifi avatar Apr 22 '17 23:04 kinifi

Hey @kinifi thanks for your help. Also that bug that you reported at the end was fixed in the last release. I'm going to close this issue out.

StanleyGoldman avatar May 01 '17 13:05 StanleyGoldman