go-git-cmd-wrapper

module
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2017 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/ldez/go-git-cmd-wrapper.svg?status.svg["GoDoc", link="https://godoc.org/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
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>...
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>...
* CODE GENERATED AUTOMATICALLY * THIS FILE MUST NOT BE EDITED BY HAND 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>...
* CODE GENERATED AUTOMATICALLY * THIS FILE MUST NOT BE EDITED BY HAND 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>...
* CODE GENERATED AUTOMATICALLY * THIS FILE MUST NOT BE EDITED BY HAND 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.
* CODE GENERATED AUTOMATICALLY * THIS FILE MUST NOT BE EDITED BY HAND 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.
* CODE GENERATED AUTOMATICALLY * THIS FILE MUST NOT BE EDITED BY HAND 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.
* CODE GENERATED AUTOMATICALLY * THIS FILE MUST NOT BE EDITED BY HAND 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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>...
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>...
git rev-parse [ --option ] <args>...
git rev-parse [ --option ] <args>...

Jump to

Keyboard shortcuts

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