Repository
Object Hierarchy:
Description:
Represents an existing git repository including all of it's object contents.
Namespace: Ggit
Package: libgit2-glib-1.0
Content:
Properties:
- public CloneOptions clone_options { owned get; construct; }
- public Ref head { owned get; }
- public bool init { get; construct; }
- public bool is_bare { get; construct; }
- public File location { owned get; construct; }
- public string url { owned get; construct; }
- public File workdir { owned get; set construct; }
Static methods:
- public static Repository? clone (string url, File location, CloneOptions? options) throws Error
Clones a new git repository in the given folder.
- public static File? discover (File location) throws Error
Looks for a git repository.
- public static File? discover_full (File location, bool across_fs, string[]? ceiling_dirs) throws Error
Looks for a git repository.
- public static Repository? init_repository (File location, bool is_bare) throws Error
Creates a new git repository in the given folder.
- public static Repository? open (File location) throws Error
Open a git repository.
Creation methods:
- protected Repository ()
Methods:
- public void add_remote_fetch (Remote remote, string refspec) throws Error
Adds a fetch refspec to the
remote
's configuration. - public void add_remote_push (Remote remote, string refspec) throws Error
Adds a push refspec to
remote
's configuration. - public Blame? blame_file (File file, BlameOptions? blame_options) throws Error
Get a blame for a single file.
- public bool checkout_head (CheckoutOptions? options) throws Error
Update files in the working tree to reflect the contents of current HEAD.
- public bool checkout_index (Index? index, CheckoutOptions? options) throws Error
Update files in the working tree to reflect the contents of the index.
- public bool checkout_tree (Object? tree, CheckoutOptions? options) throws Error
Update files in the working tree to reflect the contents of the specified commit, tag or tree object.
- public bool cherry_pick (Commit commit, CherryPickOptions options) throws Error
Cherry pick the specified commit, making changes in the index and the working directory.
- public Index? cherry_pick_commit (Commit commit, Commit our_commit, uint mainline, MergeOptions? merge_options) throws Error
Cherry-picks the given
commit
against the providedour_commit
, producing and index that reflects the result of the cherry-pick. - public BlobOutputStream? create_blob ()
Create a new blob and return a OutputStream to write contents to the blob.
- public OId? create_blob_from_buffer (uint8[] buffer) throws Error
Write an in-memory buffer to the object database as a blob.
- public OId create_blob_from_file (File file) throws Error
Write a file to the object database as a blob.
- public OId? create_blob_from_path (string path) throws Error
Write a path relative to the repository working directory to the object database as a blob.
- public Branch? create_branch (string branch_name, Object target, CreateFlags flags) throws Error
Creates a new branch pointing at a target commit.
- public OId? create_commit (string? update_ref, Signature author, Signature committer, string? message_encoding, string message, Tree tree, Commit[] parents) throws Error
Create a new commit.
- public string? create_commit_buffer (Signature author, Signature committer, string? message_encoding, string message, Tree tree, Commit[] parents) throws Error
Create a commit as with
git_commit_create
but instead of writing it to the objectdb, write the contents of the object into a buffer. - public OId? create_commit_from_ids (string? update_ref, Signature author, Signature committer, string? message_encoding, string message, OId tree, OId[] parents) throws Error
Create a new commit.
- public OId? create_commit_with_signature (string commit_content, string? signature, string? signature_field) throws Error
Given the unsigned commit object's contents, its signature and the header field in which to store the signature, attach the signature to the commit and write it into the given repositoryCreate a new commit using the (if not NULL) signature key and type of key provided.
- public IndexEntry? create_index_entry_for_file (File? file, OId? id) throws Error
Create a new index entry.
- public IndexEntry? create_index_entry_for_path (string? path, OId? id) throws Error
Create a new index entry.
- public OId? create_note (string? notes_ref, Signature author, Signature committer, OId id, string note, bool force) throws Error
Adds a note for an object.
- public Ref? create_reference (string name, OId oid, string log_message) throws Error
Creates a new object id reference.
- public Remote? create_remote (string name, string url) throws Error
Adds a remote with the default fetch refspec to the repository's configuration.
- public Ref? create_symbolic_reference (string name, string target, string log_message) throws Error
Creates a new symbolic reference.
- public OId? create_tag (string tag_name, Object target, Signature tagger, string message, CreateFlags flags) throws Error
Create a new tag object.
- public OId? create_tag_annotation (string tag_name, Object target, Signature signature, string message) throws Error
Creates a new annotated tag.
- public OId? create_tag_from_buffer (string tag, CreateFlags flags) throws Error
Create a new tag from a buffer describing the tag object.
- public OId? create_tag_lightweight (string tag_name, Object target, CreateFlags flags) throws Error
Creates a new lightweight tag.
- public TreeBuilder? create_tree_builder () throws Error
Create a new tree builder.
- public TreeBuilder? create_tree_builder_from_tree (Tree tree) throws Error
Create a tree builder for initialized with
tree
. - public bool delete_tag (string name) throws Error
Delete an existing tag reference by name.
- public void drop_stash (size_t index) throws Error
Removes a single stashed state from the stash list.
- public BranchEnumerator? enumerate_branches (BranchType list_type) throws Error
Get a branch enumerator to enumerate over all branches of the specified
list_type
in this. - public StatusFlags file_status (File location) throws Error
Gets the file status for a single file.
- public bool file_status_foreach (StatusOptions? options, StatusCallback callback) throws Error
Gathers file statuses and run a callback for each one.
- public void get_ahead_behind (OId local, OId upstream, out size_t ahead, out size_t behind) throws Error
Count the number of unique commits between two commit objects.
- public unowned string? get_attribute (string path, string name, AttributeCheckFlags flags) throws Error
Get the attribute value of the specified attribute for the given file.
- public Config? get_config () throws Error
Get the config for a specific repository.
- public string? get_default_notes_ref () throws Error
Gets the default notes reference for this.
- public bool get_descendant_of (OId commit, OId ancestor) throws Error
Check whether
com
mit is a descendant ofancestor
. - public Ref? get_head () throws Error
Get and resolves the current HEAD reference of the repository.
- public Index? get_index () throws Error
Get the index for a specific repository.
- public File? get_location ()
Get the gitdir location of the repository.
- public SubmoduleStatus get_submodule_status (string name, SubmoduleIgnore ignore) throws Error
Gets the status for a submodule.
- public File? get_workdir ()
Gets the working directory of the repository.
- public bool is_empty () throws Error
Checks if this is empty.
- public bool is_head_detached () throws Error
Checks if this's HEAD is detached.
- public bool is_head_unborn () throws Error
Checks if this's HEAD is an orphan.
- public string[]? list_remotes () throws Error
Fill a list with all the remotes in this.
- public string[]? list_tags () throws Error
Fill a list with all the tags in the this.
- public string[]? list_tags_match (string? pattern) throws Error
Fill a list with all the tags in the this matching the provided pattern.
- public Object? lookup (OId oid, Type gtype) throws Error
Lookups a reference to one of the objects in the this.
- public Blob? lookup_blob (OId oid) throws Error
Lookups a branch by its name in a repository.
- public Branch? lookup_branch (string branch_name, BranchType branch_type) throws Error
Lookups a branch by its name in a repository.
- public Commit? lookup_commit (OId oid) throws Error
Lookups a branch by its name in a repository.
- public Ref? lookup_reference (string name) throws Error
Lookups a reference by its name in this.
- public Ref? lookup_reference_dwim (string short_name) throws Error
Lookups a reference by its short name in this applying the git precendence rules to the given shorthand to determine which reference the user is referring to.
- public Remote? lookup_remote (string name) throws Error
Gets the remote called
name
. - public Submodule? lookup_submodule (string name) throws Error
Lookups a submodule information by name or path.
- public Tag? lookup_tag (OId oid) throws Error
Lookups a branch by its name in a repository.
- public Tree? lookup_tree (OId oid) throws Error
Lookups a branch by its name in a repository.
- public void merge (AnnotatedCommit[] their_heads, MergeOptions merge_opts, CheckoutOptions checkout_opts) throws Error
Merges the given commit(s) into HEAD, writing the results into the working directory.
- public OId? merge_base (OId oid_one, OId oid_two) throws Error
Find the merge base between two commits
- public Index? merge_commits (Commit our_commit, Commit their_commit, MergeOptions merge_options) throws Error
Merge two commits creating a Index reflecting the result of the merge.
- public Index? merge_trees (Tree ancestor_tree, Tree our_tree, Tree their_tree, MergeOptions merge_options) throws Error
Merge two trees creating a Index reflecting the result of the merge.
- public bool note_foreach (string? notes_ref, NoteCallback callback) throws Error
Loop over all the notes within a specified namespace and issue a callback for each one.
- public bool path_is_ignored (string path) throws Error
Tests if the ignore rules apply to the path provided.
- public Note? read_note (string? notes_ref, OId id) throws Error
Reads the note for an object.
- public Rebase? rebase_init (AnnotatedCommit? branch, AnnotatedCommit? upstream, AnnotatedCommit? onto, RebaseOptions options) throws Error
Initializes a rebase operation to rebase the changes in
branch
relative toupstream
onto another branch. - public Rebase? rebase_open (RebaseOptions options) throws Error
Opens an existing rebase that was previously started by either an invocation of
ggit_rebase_init
or by another client. - public bool references_foreach (ReferencesCallback callback) throws Error
Gathers references and run a callback for each one.
- public bool references_foreach_name (ReferencesNameCallback callback) throws Error
Gathers reference names and run a callback for each one.
- public bool remove_note (string? notes_ref, Signature author, Signature committer, OId id) throws Error
Removes the note for an object.
- public bool remove_remote (string name) throws Error
Removes
remote
from the this. - public string[]? rename_remote (string name, string new_name) throws Error
Rename the remote of this from
name
tonew_name
. - public void reset (Object target, ResetType reset_type, CheckoutOptions checkout_options) throws Error
Performs a reset of type
reset_type
on this totarget
, or throws will be set. - public void reset_default (Object? target, string[] pathspecs) throws Error
Update some entries in the index from the target commit tree.
- public bool revert (Commit commit, RevertOptions options) throws Error
Revert the given
commit
on top of the current working directory. - public Object? revparse (string spec) throws Error
Find an object, as specified by a revision string.
- public OId? save_stash (Signature stasher, string message, StashFlags flags) throws Error
Saves the local modifications to a new stash.
- public bool set_head (string ref_name) throws Error
- public bool set_head_detached (OId oid) throws Error
- public bool set_remote_url (string remote, string url) throws Error
Sets url for the
remote
from the this. - public void set_submodule_fetch_recurse (string name, SubmoduleRecurse fetch_recurse_submodules) throws Error
Sets the submodule.
- public void set_submodule_ignore (string name, SubmoduleIgnore ignore) throws Error
Sets the ignore rule for the submodule in the configuration.
- public void set_submodule_update (string name, SubmoduleUpdate update) throws Error
Sets the update rule for the submodule in the configuration.
- public void set_submodule_url (string name, string url) throws Error
Sets the URL for the submodule in the configuration.
- public void set_workdir (File workdir, bool update_gitlink)
Sets the working directory of the repository.
- public bool stash_foreach (StashCallback callback) throws Error
Loops over all the stashed states and issue a callback for each one.
- public bool submodule_foreach (SubmoduleCallback callback) throws Error
Gathers submodules and run a callback for each one.
- public bool tag_foreach (TagCallback callback) throws Error
Get all the tags in the repository and run the provided callback on each.
Inherited Members:
All known members inherited from class Ggit.Native
All known members inherited from class GLib.Object
All known members inherited from interface GLib.Initable