Share via


TfsGitRepository Class

This is one of the two core classes to the TFS Git server object model. It represents a repository on a Team Project Collection. You can't new a TfsGitRepository yourself -- create, delete, fork, and acquisition of an existing TfsGitRepository are all done through the TeamFoundationGitRepositoryService's methods. Consumers of this class should not cache TfsGitRepository instances across logical requests.

Inheritance Hierarchy

System.Object
  Microsoft.TeamFoundation.Git.Server.TfsGitRepository

Namespace:  Microsoft.TeamFoundation.Git.Server
Assembly:  Microsoft.TeamFoundation.Git.Server (in Microsoft.TeamFoundation.Git.Server.dll)

Syntax

'Declaration
Public Class TfsGitRepository _
    Implements IDisposable
public class TfsGitRepository : IDisposable
public ref class TfsGitRepository : IDisposable
type TfsGitRepository =  
    class 
        interface IDisposable 
    end
public class TfsGitRepository implements IDisposable

The TfsGitRepository type exposes the following members.

Properties

  Name Description
Public property Name Every Git repository has a name. The name is unique in the scope of the collection.
Public property Refs The collection of refs for this Git repository. This object has multiple methods on it for reading and writing refs to the repository.
Public property RepositoryId A Team Project Collection may contain multiple Git repositories. They are differentiated by their name as well as by their repository ID.
Public property TeamProjectUri The uri for the team project that owns this Git Repository. Currently, a team project can only have one Git Repository

Top

Methods

  Name Description
Public method Dispose()
Protected method Dispose(Boolean)
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize We MUST make sure we dispose of the underlying memory mapped files! (Overrides Object.Finalize().)
Public method GetDefaultBranch Get the default branch for this repository as a TfsGitRef. If there is not a default branch, it will return null.
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetRepositoryUri
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method LookupObject Looks up the Git object with the given object ID (20-byte SHA-1 hash).
Public method LookupObjectType Looks up the Git object type with the given object ID (20-byte SHA-1 hash).
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method TryLookupObject Looks up the Git object with the given object ID (20-byte SHA-1 hash).
Public method TryLookupObjectType Looks up the Git object type with the given object ID (20-byte SHA-1 hash).

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.TeamFoundation.Git.Server Namespace