virtual protected void OnInitializeRepository() { var item = GetItems()[0]; var vcs = (from v in VersionControlService.GetVersionControlSystems() where v is GitVersionControl select v).FirstOrDefault(); if (vcs != null && vcs.IsInstalled) { var rep = new GitRepository(vcs, item.Path); rep.Initialize(); rep.Add(GetAllFiles(item.WorkspaceObject), false, null); if (item.WorkspaceObject is Solution) ((Solution)item.WorkspaceObject).NeedsReload = true; else if (item.WorkspaceObject is Project) ((Project)item.WorkspaceObject).NeedsReload = true; else System.Diagnostics.Debug.Assert(false, "Item should be either solution or project."); } }