javagit/src/main/java/edu/nyu/cs/javagit/api/commands/GitBranch.java
public GitBranchResponse renameBranch(File repositoryPath, boolean forceRename, Ref newName) 
      throws IOException, JavaGitException {
    CheckUtilities.checkNullArgument(repositoryPath, "repository path");
    CheckUtilities.checkNullArgument(newName, "new name");
    CheckUtilities.validateArgumentRefType(newName, Ref.RefType.BRANCH, "new name");

    IClient client = ClientManager.getInstance().getPreferredClient();
    IGitBranch gitBranch = client.getGitBranchInstance();
    return gitBranch.renameBranch(repositoryPath, forceRename, newName);
  }
public GitBranchResponse renameBranch(File repositoryPath, boolean forceRename, Ref newName) 
      throws IOException, JavaGitException {
    CheckUtilities.checkNullArgument(repositoryPath, "repository path");
    CheckUtilities.checkNullArgument(newName, "new name");
    CheckUtilities.validateArgumentRefType(newName, Ref.RefType.BRANCH, "new name");

    IClient client = ClientManager.getInstance().getPreferredClient();
    IGitBranch gitBranch = client.getGitBranchInstance();
    return gitBranch.renameBranch(repositoryPath, forceRename, newName);
  }
public GitBranchResponse renameBranch ( File repositoryPath , boolean forceRename , Ref newName ) throws IOException , JavaGitException { CheckUtilities . checkNullArgument ( repositoryPath , "repository path" ) ; CheckUtilities . checkNullArgument ( newName , "new name" ) ; CheckUtilities . validateArgumentRefType ( newName , Ref . RefType . BRANCH , "new name" ) ; IClient client = ClientManager . getInstance ( ) . getPreferredClient ( ) ; IGitBranch gitBranch = client . getGitBranchInstance ( ) ; return gitBranch . renameBranch ( repositoryPath , forceRename , newName ) ; }
Renames the current branch to new branch.

@param repositoryPath
A <code>File</code> instance for the path to the repository. If null is passed,
a <code>NullPointerException</code> will be thrown.
@param forceRename
True if force rename option -M should be used. False if -m should be used.
@param newName
When renaming the current branch to a new branch name, this is the new branch name.
@return The result of the git branch with -m option.
@throws IOException
There are many reasons for which an <code>IOException</code> may be thrown.
Examples include:
<ul>
<li>a directory doesn't exist</li>
<li>access to a file is denied</li>
<li>a command is not found on the PATH</li>
</ul>
@throws JavaGitException
Thrown when there is an error executing git-branch.
Renames the current branch to new branch .