Git config breaking on every commit

Product: PowerShell Universal
Version: 4.2.4

Hi,

Since the upgrade my GIT setup has been broken. I cant roll back for security purposes so this issue is urgent as i cant easily commit changes anymore.

Basically what happens is every minute PowerShell Universal shows this error in both the logs and the notifications in the portal: “There is no tracking information for the current branch”. I can fix this by doing a git branch -u origin/master which cleans up the config file in the .git folder. Every time I do any commit after this change, the config file reverts to its failing state.

My appsettings looks like this:

"GitRemote": "Snipped",
    "GitUserName": "Snipped",
    "GitPassword": "Snipped",
    "GitBranch": "",
    "GitSyncBehavior": "TwoWay",
    "ConfigurationScript": "",
    "GitInitializeBehavior" : "" ,
    "Mode": "Manual"

Ive been using this configuration for a while now so it must be something to do with the upgrade. When the config file is in its working state it looks like this:

[core]
    bare = false
    repositoryformatversion = 0
    filemode = false
    symlinks = false
    ignorecase = true
    logallrefupdates = true
[remote "origin"]
	url = URL
[branch "master"]
	remote = origin
	merge = refs/heads/master
[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*

but after a commit and when its broken, it looks like this:

[core]
    bare = false
    repositoryformatversion = 0
    filemode = false
    symlinks = false
    ignorecase = true
    logallrefupdates = true
[remote "origin"]
	url = URL
[branch "master"]
[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*

So its missing the remote and merge options under the branch master section.