コード例 #1
0
 private void PreCommand()
 {
     EnvHelper.GetGitConfig();
     EnvHelper.GetBranchName();
     EnvHelper.GetStash();
     FileHelper.SaveAllFiles(_dte);
 }
コード例 #2
0
 public void SolutionEvents_Opened()
 {
     EnvHelper.GetTortoiseGitProc();
     EnvHelper.GetGit();
     EnvHelper.GetSolutionDir(_dte);
     EnvHelper.GetGitConfig();
     EnvHelper.GetBranchName();
     EnvHelper.GetStash();
 }
コード例 #3
0
ファイル: GitFlowMenuCommands.cs プロジェクト: bdn-mca/TGit
        private void InitCommand(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(EnvHelper.SolutionDir))
            {
                return;
            }

            var flowDialog = new FlowDialog();

            if (flowDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var versionTag = string.IsNullOrEmpty(flowDialog.GitConfig.TagPrefix) ? "\"\"" : flowDialog.GitConfig.TagPrefix;

            /* 1. Add GitFlow config options
             * 2. Checkout develop branch (create if it doesn't exist, reset if it does)
             * 3. Push develop branch
             */
            var process = ProcessHelper.StartProcessGui(
                "cmd.exe",
                $"/c cd \"{EnvHelper.SolutionDir}\" && " +
                GitHelper.GetSshSetup() +
                FormatCliCommand($"config --add gitflow.branch.master {flowDialog.GitConfig.MasterBranch}") +
                FormatCliCommand($"config --add gitflow.branch.develop {flowDialog.GitConfig.DevelopBranch}") +
                FormatCliCommand($"config --add gitflow.prefix.feature {flowDialog.GitConfig.FeaturePrefix}") +
                FormatCliCommand($"config --add gitflow.prefix.release {flowDialog.GitConfig.ReleasePrefix}") +
                FormatCliCommand($"config --add gitflow.prefix.hotfix {flowDialog.GitConfig.HotfixPrefix}") +
                FormatCliCommand($"config --add gitflow.prefix.versiontag {versionTag}") +
                (GitHelper.RemoteBranchExists(flowDialog.GitConfig.DevelopBranch) ?
                 "echo." :
                 FormatCliCommand($"checkout -b {flowDialog.GitConfig.DevelopBranch}", false)),
                "Initializing GitFlow"
                );

            process.WaitForExit();

            EnvHelper.GetGitConfig();
            EnvHelper.GetBranchName();
        }