Missing .gitconfig files after installing Git on a new Windows 10 box (Source Tree won't launch Beyond Compare)

2,286 views
Skip to first unread message

adamj...@gmail.com

unread,
Apr 24, 2020, 5:48:18 PM4/24/20
to git-for-windows
Hello all!

I'm setting up my new Windows 10 box and I'm having issues with opening Beyond Compare from Source Tree. I think this is stemming from an improper Git installation. Maybe...? So, here's what I did: 

I downloaded the Windows Git installer from here: https://git-scm.com/download/win 

This created the Git directory structure here: C:\Program Files\Git 

Looks good so far. But while investigating why Source Tree wasn't behaving well with Beyond Compare, I ran across this post: https://community.atlassian.com/t5/Sourcetree-questions/external-diff-stopped-working/qaq-p/970290

To summarize, it suggested manually editing the .gitconfig files here: 
C:\Users\<username>\.gitconfig
C:\Program Files\Git\mingw64\etc\gitconfig

The problem is, those files don't exist in these folders! I did some more research and I found a post saying to run, "git clone https://github.com/git/git". I did so at the root C: and all it did was create a new C:\git folder. There're a lot of files and folder in there but no .gitconfig file is here either. 
 
Thoughts?

Thanks!

Bryan Turner

unread,
Apr 24, 2020, 7:04:41 PM4/24/20
to adamj...@gmail.com, git-for-windows
On Fri, Apr 24, 2020 at 2:48 PM <adamj...@gmail.com> wrote:
>
> Hello all!
>
> I'm setting up my new Windows 10 box and I'm having issues with opening Beyond Compare from Source Tree. I think this is stemming from an improper Git installation. Maybe...? So, here's what I did:
>
> I downloaded the Windows Git installer from here: https://git-scm.com/download/win
>
> This created the Git directory structure here: C:\Program Files\Git
>
> Looks good so far. But while investigating why Source Tree wasn't behaving well with Beyond Compare, I ran across this post: https://community.atlassian.com/t5/Sourcetree-questions/external-diff-stopped-working/qaq-p/970290
>
> To summarize, it suggested manually editing the .gitconfig files here:
> C:\Users\<username>\.gitconfig

If you start "Git Bash" and run "git config --global --edit" it should
help you create this file. It will open the file for editing in
whatever editor you selected to use when you installed Git. The file
will start out empty, but you can add whatever lines you'd like and
when you save they'll be written to C:\Users\<username>\.gitconfig.

> C:\Program Files\Git\mingw64\etc\gitconfig

This file exists in my own Git installation. Perhaps your Git install
did not complete?

>
> The problem is, those files don't exist in these folders! I did some more research and I found a post saying to run, "git clone https://github.com/git/git". I did so at the root C: and all it did was create a new C:\git folder. There're a lot of files and folder in there but no .gitconfig file is here either.

This is cloning the source code for Git itself, and is unlikely to
help you set up a diff tool.

>
> Thoughts?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups "git-for-windows" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to git-for-windo...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/git-for-windows/12a14566-439f-4493-b36d-9a2a4a13da73%40googlegroups.com.

Johannes Schindelin

unread,
Apr 25, 2020, 9:53:04 AM4/25/20
to Bryan Turner, adamj...@gmail.com, git-for-windows
Hi,

On Fri, 24 Apr 2020, Bryan Turner wrote:

> On Fri, Apr 24, 2020 at 2:48 PM <adamj...@gmail.com> wrote:
> >
> > I'm setting up my new Windows 10 box and I'm having issues with
> > opening Beyond Compare from Source Tree. I think this is stemming from
> > an improper Git installation. Maybe...? So, here's what I did:
> >
> > I downloaded the Windows Git installer from here:
> > https://git-scm.com/download/win
> >
> > This created the Git directory structure here: C:\Program Files\Git
> >
> > Looks good so far. But while investigating why Source Tree wasn't
> > behaving well with Beyond Compare, I ran across this post:
> > https://community.atlassian.com/t5/Sourcetree-questions/external-diff-stopped-working/qaq-p/970290
> >
> > To summarize, it suggested manually editing the .gitconfig files here:
> > C:\Users\<username>\.gitconfig
>
> If you start "Git Bash" and run "git config --global --edit" it should
> help you create this file. It will open the file for editing in whatever
> editor you selected to use when you installed Git. The file will start
> out empty, but you can add whatever lines you'd like and when you save
> they'll be written to C:\Users\<username>\.gitconfig.
>
> > C:\Program Files\Git\mingw64\etc\gitconfig
>
> This file exists in my own Git installation. Perhaps your Git install
> did not complete?

That file used to be the correct location, but a change some time last
year moved the system config to `C:\Program Files\Git\etc\gitconfig`.

Originally, when moving Git for Windows to v2.x in 2015, that change came
with the move of `git.exe` and friends into `/mingw64/`, and I was quite
surprised that other projects seemed to expect the location of either to
be anything else than an internal implementation detail.

We introduced the location `C:\ProgramData\Git\config` to make up for that
move, but there were many, many problems with it, not the least of which
that nobody seemed to respect that location (or even know about it).

In any case, whenever you want to suggest to users to look at the
user-wide or system-wide config, you should use `git config --edit
--global` or `git config --edit --system`. Never, ever, the absolute path.
People might install things into different locations, and files _can_
move, so that's all so confusing and easily prevented.

Ciao,
Johannes

adamj...@gmail.com

unread,
Apr 27, 2020, 5:08:28 PM4/27/20
to git-for-windows
Okay, I've got the file .gitconfig file generated but SourceTree still isn't doing what it's supposed to. I found the SourceTree log and these items are in it:

ERROR [2020-04-27 16:59:32,956] [1] [SourceTree.Analytics.Submission.Gas.GasAnalyticsSubmissionService] [Log] - Hi There! 
ERROR [2020-04-27 16:59:33,060] [1] [SourceTree.Model.Repository] [Log] - Repository: [] does not exist
ERROR [2020-04-27 16:59:33,090] [1] [SourceTree.Model.Repository] [Log] - Repository: [] does not exist
ERROR [2020-04-27 16:59:55,219] [17] [Sourcetree.Installer.Squirrel.Utils.UpdateHelper] [Log] - Failed to check for updates
System.Exception: Failed to check for updates ---> System.MissingMethodException: Method not found: 'Void Splat.IFullLogger.Info(System.String, !!0)'.
   at Squirrel.UpdateManager.CheckForUpdateImpl.<CheckForUpdate>d__2.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at Squirrel.UpdateManager.CheckForUpdateImpl.CheckForUpdate(String localReleaseFile, String updateUrlOrPath, Boolean ignoreDeltaUpdates, Action`1 progress, IFileDownloader urlDownloader)
   at Squirrel.UpdateManager.<CheckForUpdate>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sourcetree.Installer.Squirrel.Utils.UpdateHelper.<CheckForUpdate>d__19.MoveNext()
   --- End of inner exception stack trace ---
   at Sourcetree.Installer.Squirrel.Utils.UpdateHelper.<CheckForUpdate>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sourcetree.Installer.Squirrel.Utils.UpdateHelper.<HasAvailableUpdates>d__20.MoveNext()

These aren't being generated while attempting to open BeyondCompare but I wonder if it's an underlying issue. I tried the suggestions here but I'm still getting these errors. 

I'll have to look more into this in the morning.

Erik Blake

unread,
May 1, 2020, 4:28:59 PM5/1/20
to git-for-windows
Simply create C:\Users\<username>\.gitconfig using your favourite text editor.

I use the following .gitconfig settings for BeyondCompare (these entries are placed in .gitconfig):

[difftool "sourcetree"]
    cmd = 'C:/Program Files/Beyond Compare 4/BComp.exe' \"$LOCAL\" \"$REMOTE\"
   path = 'C:/Program Files/Beyond Compare 4/BComp.exe'
[mergetool "sourcetree"]
    cmd = 'C:/Program Files/Beyond Compare 4/BComp.exe' \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"
    trustExitCode = true
   path = 'C:/Program Files/Beyond Compare 4/BComp.exe'

e\

p.s. I'm still using Sourcetree 1.8/1.9 because they are the last versions that truly had a source tree! I have made some configuration changes to address the security issues with this old version.

adamj...@gmail.com

unread,
May 1, 2020, 4:42:23 PM5/1/20
to git-for-windows
I finally figured this out! Git installed with the default home directory of H:\. I don't even have an H drive! So, SourceTree couldn't fine any .gitconfig file! And I couldn't find anywhere that told me how to change this setting in Git. 

To fix this I endded up having to add a user variable to the environment variables collection in Windows. 
Variable: HOME
Value: C:\Users\ahilton

And then everything just started working. 

I still have a red exclamation point over my Remote icon but this does't seem to be impacting anything. 

Thanks everyone for your input!
Reply all
Reply to author
Forward
0 new messages