VersionInfo?GetFromGit()
        {
            if (!GitTasks.GitIsDetached())
            {
                var commitCount = GitTasks.Git("rev-list HEAD --count", logOutput: false).Select(x => x.Text).Single();
                var branch      = GitTasks.GitCurrentBranch()?.Replace("refs/heads/", "").Replace("/", "-");
                var revision    = GitTasks.Git("rev-parse HEAD", logOutput: false).Select(x => x.Text).Single();

                if (!string.IsNullOrEmpty(commitCount) && !string.IsNullOrEmpty(branch) && !string.IsNullOrEmpty(revision))
                {
                    return(new VersionInfo(
                               $"{VersionMajor}.{VersionMinor}.{commitCount}.0",
                               $"{VersionMajor}.{VersionMinor}.{commitCount}.0",
                               $"{VersionMajor}.{VersionMinor}.{commitCount}.0+Branch.{branch}.Sha.{revision}",
                               IsMainBranch(branch)
                            ? $"{VersionMajor}.{VersionMinor}.{commitCount}"
                            : $"{VersionMajor}.{VersionMinor}.{commitCount}-{branch}"));
                }
            }

            return(null);
        }