def remove(path)
      object = object! path
      path += '/' if object.is_a?(Grit::Tree) && path[-1].chr != '/'
      index = @git.index
      index.read_tree 'HEAD'
      index.delete path
      type = object.is_a?(Grit::Tree) ? 'directory' : 'file'
      commit_msg = "Removed #{type} #{path}"
      index.commit commit_msg, [@git.head.commit.sha]
    end
def remove(path)
      object = object! path
      path += '/' if object.is_a?(Grit::Tree) && path[-1].chr != '/'
      index = @git.index
      index.read_tree 'HEAD'
      index.delete path
      type = object.is_a?(Grit::Tree) ? 'directory' : 'file'
      commit_msg = "Removed #{type} #{path}"
      index.commit commit_msg, [@git.head.commit.sha]
    end
Removes a single file or the complete structure of a directory with the
 given path from the HEAD revision of the repository

 *NOTE*: The data won't be lost as it will be preserved in the history of
 the Git repository.

 @param [String] path The path of the file or directory to remove from the
        repository