コード例 #1
0
 public void AutoSaveLocal(string commitMessage = "")
 {
     for (int i = 0; i < m_inTheProject.Count; i++)
     {
         QuickGit.Add(m_inTheProject[i].GetDirectoryPath());
         QuickGit.Commit(m_inTheProject[i].GetDirectoryPath(), commitMessage);
     }
 }
コード例 #2
0
    public static void DisplayGitCommands(GitLinkOnDisk gitDirectory)
    {
        bool hasUrl = gitDirectory.HasUrl();

        if (gitDirectory.Exist())
        {
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Add -a"))
            {
                QuickGit.Add(gitDirectory.GetDirectoryPath());
            }
            if (GUILayout.Button("Commit"))
            {
                QuickGit.Commit(gitDirectory.GetDirectoryPath());
            }
            if (hasUrl && GUILayout.Button("Pull"))
            {
                QuickGit.Pull(gitDirectory.GetDirectoryPath());
            }
            if (hasUrl && GUILayout.Button("Push"))
            {
                QuickGit.Push(gitDirectory.GetDirectoryPath());
            }

            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (hasUrl && GUILayout.Button("Add>Commit>Pull"))
            {
                QuickGit.AddCommitAndPush(gitDirectory.GetDirectoryPath());
            }
            if (hasUrl && GUILayout.Button("A>C>Pull + A>C>push"))
            {
                QuickGit.PullPushWithAddAndCommit(gitDirectory.GetDirectoryPath());
            }

            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Open explorer"))
            {
                Application.OpenURL(gitDirectory.GetDirectoryPath());
            }
            if (GUILayout.Button("See Status"))
            {
                QuickGit.OpenCmd(gitDirectory.GetDirectoryPath());
            }
            if (hasUrl && GUILayout.Button("Go to Server"))
            {
                Application.OpenURL(gitDirectory.GetUrl());
            }

            GUILayout.EndHorizontal();
        }
    }