go-git-cmd-wrapper

module
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2018 License: Apache-2.0

README

= Go Git Cmd Wrapper

image:https://travis-ci.org/ldez/go-git-cmd-wrapper.svg?branch=master["Build Status", link="https://travis-ci.org/ldez/go-git-cmd-wrapper"]
image:https://godoc.org/github.com/ldez/go-git-cmd-wrapper?status.svg["GoDoc", link="https://godoc.org/github.com/ldez/go-git-cmd-wrapper"]

It's a simple wrapper around `git` command.

Import `github.com/ldez/go-git-cmd-wrapper`.

[source, golang]
----
// clone
output, err := git.Clone(clone.Repository("https://github.com/ldez/gcg"))
// with debug option
output, err := git.Clone(clone.Repository("https://github.com/ldez/gcg"), git.Debug)
output, err := git.Clone(clone.Repository("https://github.com/ldez/gcg"), git.Debugger(true))

// fetch
output, err = git.Fetch(fetch.NoTags, fetch.Remote("upstream"))
output, err = git.Fetch(fetch.NoTags, fetch.Remote("upstream"), fetch.RefSpec("master"))

// add a remote
output, err = git.Remote(remote.Add, remote.Name("upstream"), remote.URL("https://github.com/ldez/gcg"))
----

More examples: link:https://godoc.org/github.com/ldez/go-git-cmd-wrapper/git[documentation]

Directories

Path Synopsis
Package add CODE GENERATED AUTOMATICALLY THIS FILE MUST NOT BE EDITED BY HAND Package add git-add - Add file contents to the index SYNOPSIS git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p] [--edit | -e] [--[no-]all | --[no-]ignore-removal | [--update | -u]] [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--chmod=(+|-)x] [--] [<pathspec>...] DESCRIPTION This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit.
Package add CODE GENERATED AUTOMATICALLY THIS FILE MUST NOT BE EDITED BY HAND Package add git-add - Add file contents to the index SYNOPSIS git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p] [--edit | -e] [--[no-]all | --[no-]ignore-removal | [--update | -u]] [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing] [--chmod=(+|-)x] [--] [<pathspec>...] DESCRIPTION This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit.
Package branch Branch https://git-scm.com/docs/git-branch usage: git branch [<options>] [-r | -a] [--merged | --no-merged] or: git branch [<options>] [-l] [-f] <branch-name> [<start-point>] or: git branch [<options>] [-r] (-d | -D) <branch-name>...
Package branch Branch https://git-scm.com/docs/git-branch usage: git branch [<options>] [-r | -a] [--merged | --no-merged] or: git branch [<options>] [-l] [-f] <branch-name> [<start-point>] or: git branch [<options>] [-r] (-d | -D) <branch-name>...
Package checkout CODE GENERATED AUTOMATICALLY THIS FILE MUST NOT BE EDITED BY HAND Package checkout git-checkout - Switch branches or restore working tree files SYNOPSIS git checkout [-q] [-f] [-m] [<branch>] git checkout [-q] [-f] [-m] --detach [<branch>] git checkout [-q] [-f] [-m] [--detach] <commit> git checkout [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>] git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
Package checkout CODE GENERATED AUTOMATICALLY THIS FILE MUST NOT BE EDITED BY HAND Package checkout git-checkout - Switch branches or restore working tree files SYNOPSIS git checkout [-q] [-f] [-m] [<branch>] git checkout [-q] [-f] [-m] --detach [<branch>] git checkout [-q] [-f] [-m] [--detach] <commit> git checkout [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>] git checkout [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>...
Package clone CODE GENERATED AUTOMATICALLY THIS FILE MUST NOT BE EDITED BY HAND Package clone git-clone - Clone a repository into a new directory SYNOPSIS git clone [--template=<template_directory>] [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror] [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>] [--dissociate] [--separate-git-dir <git dir>] [--depth <depth>] [--[no-]single-branch] [--recurse-submodules] [--[no-]shallow-submodules] [--jobs <n>] [--] <repository> [<directory>] DESCRIPTION Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository (visible using git branch -r), and creates and checks out an initial branch that is forked from the cloned repository’s currently active branch.
Package clone CODE GENERATED AUTOMATICALLY THIS FILE MUST NOT BE EDITED BY HAND Package clone git-clone - Clone a repository into a new directory SYNOPSIS git clone [--template=<template_directory>] [-l] [-s] [--no-hardlinks] [-q] [-n] [--bare] [--mirror] [-o <name>] [-b <name>] [-u <upload-pack>] [--reference <repository>] [--dissociate] [--separate-git-dir <git dir>] [--depth <depth>] [--[no-]single-branch] [--recurse-submodules] [--[no-]shallow-submodules] [--jobs <n>] [--] <repository> [<directory>] DESCRIPTION Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository (visible using git branch -r), and creates and checks out an initial branch that is forked from the cloned repository’s currently active branch.
Package commit CODE GENERATED AUTOMATICALLY THIS FILE MUST NOT BE EDITED BY HAND Package commit git-commit - Record changes to the repository SYNOPSIS git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend] [--dry-run] [(-c | -C | --fixup | --squash) <commit>] [-F <file> | -m <msg>] [--reset-author] [--allow-empty] [--allow-empty-message] [--no-verify] [-e] [--author=<author>] [--date=<date>] [--cleanup=<mode>] [--[no-]status] [-i | -o] [-S[<keyid>]] [--] [<file>...] DESCRIPTION Stores the current contents of the index in a new commit along with a log message from the user describing the changes.
Package commit CODE GENERATED AUTOMATICALLY THIS FILE MUST NOT BE EDITED BY HAND Package commit git-commit - Record changes to the repository SYNOPSIS git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend] [--dry-run] [(-c | -C | --fixup | --squash) <commit>] [-F <file> | -m <msg>] [--reset-author] [--allow-empty] [--allow-empty-message] [--no-verify] [-e] [--author=<author>] [--date=<date>] [--cleanup=<mode>] [--[no-]status] [-i | -o] [-S[<keyid>]] [--] [<file>...] DESCRIPTION Stores the current contents of the index in a new commit along with a log message from the user describing the changes.
cleanup
Package cleanup --cleanup=<mode> This option determines how the supplied commit message should be cleaned up before committing.
Package cleanup --cleanup=<mode> This option determines how the supplied commit message should be cleaned up before committing.
untracked
Package untracked -u[<mode>], --untracked-files[=<mode>] The mode parameter is optional (defaults to all), and is used to specify the handling of untracked files; when -u is not used, the default is normal, i.e.
Package untracked -u[<mode>], --untracked-files[=<mode>] The mode parameter is optional (defaults to all), and is used to specify the handling of untracked files; when -u is not used, the default is normal, i.e.
Package config CODE GENERATED AUTOMATICALLY THIS FILE MUST NOT BE EDITED BY HAND Package config git-config - Get and set repository or global options SYNOPSIS git config [<file-option>] [type] [--show-origin] [-z|--null] name [value [value_regex]] git config [<file-option>] [type] --add name value git config [<file-option>] [type] --replace-all name value [value_regex] git config [<file-option>] [type] [--show-origin] [-z|--null] --get name [value_regex] git config [<file-option>] [type] [--show-origin] [-z|--null] --get-all name [value_regex] git config [<file-option>] [type] [--show-origin] [-z|--null] [--name-only] --get-regexp name_regex [value_regex] git config [<file-option>] [type] [-z|--null] --get-urlmatch name URL git config [<file-option>] --unset name [value_regex] git config [<file-option>] --unset-all name [value_regex] git config [<file-option>] --rename-section old_name new_name git config [<file-option>] --remove-section name git config [<file-option>] [--show-origin] [-z|--null] [--name-only] -l | --list git config [<file-option>] --get-color name [default] git config [<file-option>] --get-colorbool name [stdout-is-tty] git config [<file-option>] -e | --edit DESCRIPTION You can query/set/replace/unset options with this command.
Package config CODE GENERATED AUTOMATICALLY THIS FILE MUST NOT BE EDITED BY HAND Package config git-config - Get and set repository or global options SYNOPSIS git config [<file-option>] [type] [--show-origin] [-z|--null] name [value [value_regex]] git config [<file-option>] [type] --add name value git config [<file-option>] [type] --replace-all name value [value_regex] git config [<file-option>] [type] [--show-origin] [-z|--null] --get name [value_regex] git config [<file-option>] [type] [--show-origin] [-z|--null] --get-all name [value_regex] git config [<file-option>] [type] [--show-origin] [-z|--null] [--name-only] --get-regexp name_regex [value_regex] git config [<file-option>] [type] [-z|--null] --get-urlmatch name URL git config [<file-option>] --unset name [value_regex] git config [<file-option>] --unset-all name [value_regex] git config [<file-option>] --rename-section old_name new_name git config [<file-option>] --remove-section name git config [<file-option>] [--show-origin] [-z|--null] [--name-only] -l | --list git config [<file-option>] --get-color name [default] git config [<file-option>] --get-colorbool name [stdout-is-tty] git config [<file-option>] -e | --edit DESCRIPTION You can query/set/replace/unset options with this command.
Package fetch git-fetch - Download objects and refs from another repository SYNOPSIS git fetch [<options>] [<repository> [<refspec>...]] git fetch [<options>] <group> git fetch --multiple [<options>] [(<repository> | <group>)...] git fetch --all [<options>] DESCRIPTION Fetch branches and/or tags (collectively, "refs") from one or more other repositories, along with the objects necessary to complete their histories.
Package fetch git-fetch - Download objects and refs from another repository SYNOPSIS git fetch [<options>] [<repository> [<refspec>...]] git fetch [<options>] <group> git fetch --multiple [<options>] [(<repository> | <group>)...] git fetch --all [<options>] DESCRIPTION Fetch branches and/or tags (collectively, "refs") from one or more other repositories, along with the objects necessary to complete their histories.
Package init git-init - Create an empty Git repository or reinitialize an existing one SYNOPSIS git init [-q | --quiet] [--bare] [--template=<template_directory>] [--separate-git-dir <git dir>] [--shared[=<permissions>]] [directory] DESCRIPTION This command creates an empty Git repository - basically a .git directory with subdirectories for objects, refs/heads, refs/tags, and template files.
Package init git-init - Create an empty Git repository or reinitialize an existing one SYNOPSIS git init [-q | --quiet] [--bare] [--template=<template_directory>] [--separate-git-dir <git dir>] [--shared[=<permissions>]] [directory] DESCRIPTION This command creates an empty Git repository - basically a .git directory with subdirectories for objects, refs/heads, refs/tags, and template files.
Package merge git-merge - Join two or more development histories together SYNOPSIS git merge [-n] [--stat] [--no-commit] [--squash] [--[no-]edit] [-s <strategy>] [-X <strategy-option>] [-S[<keyid>]] [--[no-]allow-unrelated-histories] [--[no-]rerere-autoupdate] [-m <msg>] [<commit>...] git merge --abort git merge --continue DESCRIPTION Incorporates changes from the named commits (since the time their histories diverged from the current branch) into the current branch.
Package merge git-merge - Join two or more development histories together SYNOPSIS git merge [-n] [--stat] [--no-commit] [--squash] [--[no-]edit] [-s <strategy>] [-X <strategy-option>] [-S[<keyid>]] [--[no-]allow-unrelated-histories] [--[no-]rerere-autoupdate] [-m <msg>] [<commit>...] git merge --abort git merge --continue DESCRIPTION Incorporates changes from the named commits (since the time their histories diverged from the current branch) into the current branch.
Package pull git-pull - Fetch from and integrate with another repository or a local branch SYNOPSIS git pull [options] [<repository> [<refspec>...]] DESCRIPTION Incorporates changes from a remote repository into the current branch.
Package pull git-pull - Fetch from and integrate with another repository or a local branch SYNOPSIS git pull [options] [<repository> [<refspec>...]] DESCRIPTION Incorporates changes from a remote repository into the current branch.
Package push git-push - Update remote refs along with associated objects SYNOPSIS git push [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose] [-u | --set-upstream] [--push-option=<string>] [--[no-]signed|--sign=(true|false|if-asked)] [--force-with-lease[=<refname>[:<expect>]]] [--no-verify] [<repository> [<refspec>...]] DESCRIPTION Updates remote refs using local refs, while sending objects necessary to complete the given refs.
Package push git-push - Update remote refs along with associated objects SYNOPSIS git push [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose] [-u | --set-upstream] [--push-option=<string>] [--[no-]signed|--sign=(true|false|if-asked)] [--force-with-lease[=<refname>[:<expect>]]] [--no-verify] [<repository> [<refspec>...]] DESCRIPTION Updates remote refs using local refs, while sending objects necessary to complete the given refs.
Package rebase git-rebase - Reapply commits on top of another base tip SYNOPSIS git rebase [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>] [<upstream> [<branch>]] git rebase [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>] git rebase --continue | --skip | --abort | --quit | --edit-todo DESCRIPTION If <branch> is specified, git rebase will perform an automatic git checkout <branch> before doing anything else.
Package rebase git-rebase - Reapply commits on top of another base tip SYNOPSIS git rebase [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>] [<upstream> [<branch>]] git rebase [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>] --root [<branch>] git rebase --continue | --skip | --abort | --quit | --edit-todo DESCRIPTION If <branch> is specified, git rebase will perform an automatic git checkout <branch> before doing anything else.
Package remote git-remote - Manage set of tracked repositories SYNOPSIS git remote [-v | --verbose] git remote add [-t <branch>] [-m <master>] [-f] [--[no-]tags] [--mirror=<fetch|push>] <name> <url> git remote rename <old> <new> git remote remove <name> git remote set-head <name> (-a | --auto | -d | --delete | <branch>) git remote set-branches [--add] <name> <branch>...
Package remote git-remote - Manage set of tracked repositories SYNOPSIS git remote [-v | --verbose] git remote add [-t <branch>] [-m <master>] [-f] [--[no-]tags] [--mirror=<fetch|push>] <name> <url> git remote rename <old> <new> git remote remove <name> git remote set-head <name> (-a | --auto | -d | --delete | <branch>) git remote set-branches [--add] <name> <branch>...
Package reset git-reset - Reset current HEAD to the specified state SYNOPSIS git reset [-q] [<tree-ish>] [--] <paths>...
Package reset git-reset - Reset current HEAD to the specified state SYNOPSIS git reset [-q] [<tree-ish>] [--] <paths>...
Package revparse git-rev-parse - Pick out and massage parameters SYNOPSIS git rev-parse [ --option ] <args>...
Package revparse git-rev-parse - Pick out and massage parameters SYNOPSIS git rev-parse [ --option ] <args>...
Package worktree git-worktree - Manage multiple working trees SYNOPSIS git worktree add [-f] [--detach] [--checkout] [--lock] [-b <new-branch>] <path> [<branch>] git worktree list [--porcelain] git worktree lock [--reason <string>] <worktree> git worktree prune [-n] [-v] [--expire <expire>] git worktree unlock <worktree> DESCRIPTION Manage multiple working trees attached to the same repository.
Package worktree git-worktree - Manage multiple working trees SYNOPSIS git worktree add [-f] [--detach] [--checkout] [--lock] [-b <new-branch>] <path> [<branch>] git worktree list [--porcelain] git worktree lock [--reason <string>] <worktree> git worktree prune [-n] [-v] [--expire <expire>] git worktree unlock <worktree> DESCRIPTION Manage multiple working trees attached to the same repository.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL