title: Doing a Move and an edit in one Commit with Git TFS API in C#?
body: <p>I am trying to edit one of our files and also move it to another place in our repo and so far have this setup:</p>
  
  <pre><code>        GitRepository repo = new GitRepository();
          repo.Id = new Guid(RepositoryId);
          repo.Url = "Working.url.goes.here.com";
          repo.DefaultBranch = "heads/master";
  
          GitRef defaultBranch = GitClient.GetRefsAsync(repo.Id, filter: repo.DefaultBranch).Result.First();
  
          string result = testpath.Replace(ACTUALFILEPATH, "");
  
          GitCommitRef newCommit;
          List&lt;GitChange&gt; changes;
  
          GitRefUpdate newBranch = new GitRefUpdate()
          {
              Name = currBranch,
              OldObjectId = defaultBranch.ObjectId,
          };
  
          changes = new List&lt;GitChange&gt;(3);
  
              //the changes for the test being edited
              changes.Add(new GitChange()
              {
                  ChangeType = VersionControlChangeType.Add,
                  Item = new GitItem() { Path = result },
                  NewContent = new ItemContent()
                  {
                      Content = TestContent,
                      ContentType = ItemContentType.RawText
                  },
              });
  
              //the changes for the csproj file
              changes.Add(new GitChange()
              {
                  ChangeType = VersionControlChangeType.Edit,
                  Item = new GitItem() { Path = projPath },
                  NewContent = new ItemContent()
                  {
                      Content = projContent,
                      ContentType = ItemContentType.RawText
                  },
              });
  
              //The deletion of the old file
              changes.Add(new GitChange()
              {
                  ChangeType = VersionControlChangeType.Delete,
                  Item = new GitItem() { Path = origpath },
              });
  
              newCommit = new GitCommitRef()
              {
                  Comment = commitmessage,
                  Changes = changes.ToArray()
              };
  
              GitPush push = GitClient.CreatePushAsync(new GitPush()
          {
              RefUpdates = new GitRefUpdate[] { newBranch },
              Commits = new GitCommitRef[] { newCommit },
              Repository = repo
          }, repo.Id).Result;
  
          return result;
  </code></pre>
  
  <p>Everytime I try to run it, either the delete causes an error that says you cant modify the same file twice in one commit, or if I move the delete to before it says the file doesnt exist in the directory of the branch.  </p>
  
  <p>What I need: To be able to move a test from one directory to another, edit its contents, and also edit the contents of another file, and push all that to the server.  </p>
  
  <p>Other Notes: Use of Powershell and Cmd are very limited.</p>
  
  <p>Any Thoughts or suggestions or know what is wrong? Thanks so much for helping!</p>