Search Unity

Git command prompt opens frantically in Editor

Discussion in 'Editor & General Support' started by gumboots, May 11, 2020.

  1. gumboots

    gumboots

    Joined:
    May 24, 2011
    Posts:
    298
    Hi all,

    I have had an issue pop up in the last couple of days, where whenever the game is loading things from the harddisk (I assume), a Git cmd window opens and closes almost instantly over and over for the duration. It only seems to happen in play mode, and it doesn't happen at all in a build.

    With Task Manager I can occasionally catch the processes. They're always children of the Unity process:



    They're only there very briefly, then the Console Window Host and Git for Windows processes are gone.

    I've tried updating my Git installation, as well as the Editor and neither saw results.

    Any help is greatly appreciated!
     
    Last edited: May 11, 2020
  2. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    I've been having this issue in Unity 2020.3.22f1 - Has anyone been able to fix this yet?

    It steals focus when it happens, making it impossible to test my project.

    On top of the results @gumboots posted, rebuilding the project library also does nothing. The only way to fix it has been to close Unity, which is not preferable.
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,746
    Not sure why you would ever see this. My two git clients (the command line and SourceTree) are completely apart and separate and unrelated to Unity.

    Are you using some kind of Unity git plugin? I would recommend against that... one program, one function.

    Here's my standard source control blurb:

    Please consider using proper industrial-grade enterprise-qualified source control in order to guard and protect your hard-earned work.

    Personally I use git (completely outside of Unity) because it is free and there are tons of tutorials out there to help you set it up as well as free places to host your repo (BitBucket, Github, Gitlab, etc.).

    You can also push git repositories to other drives: thumb drives, USB drives, network drives, etc., effectively putting a complete copy of the repository there.

    As far as configuring Unity to play nice with git, keep this in mind:

    https://forum.unity.com/threads/prefab-links-keep-getting-dumped-on-git-pull.646600/#post-7142306

    Here's how I use git in one of my games, Jetpack Kurt:

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

    Using fine-grained source control as you work to refine your engineering:

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

    Setting up an appropriate .gitignore file for Unity3D:

    https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067

    Generally setting Unity up (includes above .gitignore concepts):

    https://thoughtbot.com/blog/how-to-git-with-unity

    It is only simple economics that you must expend as much effort into backing it up as you feel the work is worth in the first place. Digital storage is so unbelievably cheap today that you can buy gigabytes of flash drive storage for about the price of a cup of coffee. It's simply ridiculous not to back up.

    "Use source control or you will be really sad sooner or later." - StarManta on the Unity3D forum boards
     
  4. impzter

    impzter

    Joined:
    Jun 4, 2018
    Posts:
    2
    Has anyone found a resolution to this? Just installed Unity on a fresh computer: version 2021.3.21f1. It seems that as Unity is running importing about 30 git prompts sporadically open and close.

    I'm on Windows 11. It previously didn't seem to happen on Windows 10 but installed git through scoop this time around instead of chocolatey.
     
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,746
    There might be new "detect git and detect being in a repository" function built into Unity nowadays, not sure. Check in the ProjectSettings -> Version Control and turn it off if you want to do it yourself (my preference obviously).
     
  6. tonycoculuzzi

    tonycoculuzzi

    Joined:
    Jun 2, 2011
    Posts:
    301
    In my case, it was an issue with Android Logcat.

    I had the logcat window open but docked in the editor. As soon as closed the logcat editor window, it stopped happening. I hope this helps!