go_git_cmd_wrapper

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2020 License: Apache-2.0 Imports: 0 Imported by: 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://pkg.go.dev/github.com/ldez/go-git-cmd-wrapper"]
image:https://goreportcard.com/badge/github.com/ldez/go-git-cmd-wrapper["Go Report Card", link="https://goreportcard.com/report/github.com/ldez/go-git-cmd-wrapper"]

image:https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg["Say Thanks!", link="https://saythanks.io/to/ldez"]

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://pkg.go.dev/github.com/ldez/go-git-cmd-wrapper/git?tab=doc[documentation]

Documentation

Overview

Package go_git_cmd_wrapper A simple wrapper around `git` command.

import (
	// ...
	"github.com/ldez/go-git-cmd-wrapper/git"
	// ...
	"github.com/ldez/go-git-cmd-wrapper/clone"
	"github.com/ldez/go-git-cmd-wrapper/config"
	"github.com/ldez/go-git-cmd-wrapper/fetch"
	"github.com/ldez/go-git-cmd-wrapper/remote"
)

// 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"))

Directories

Path Synopsis
Package add git-add - Add file contents to the index.
Package add git-add - Add file contents to the index.
Package branch git-branch - List, create, or delete branches.
Package branch git-branch - List, create, or delete branches.
Package checkout git-checkout - Switch branches or restore working tree files.
Package checkout git-checkout - Switch branches or restore working tree files.
Package clone git-clone - Clone a repository into a new directory.
Package clone git-clone - Clone a repository into a new directory.
Package commit git-commit - Record changes to the repository.
Package commit git-commit - Record changes to the repository.
cleanup
Package cleanup This option determines how the supplied commit message should be cleaned up before committing.
Package cleanup This option determines how the supplied commit message should be cleaned up before committing.
untracked
Package untracked 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 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 git-config - Get and set repository or global options.
Package config git-config - Get and set repository or global options.
Package fetch git-fetch - Download objects and refs from another repository.
Package fetch git-fetch - Download objects and refs from another repository.
Package git Main package of the git commands.
Package git Main package of the git commands.
Package init git-init - Create an empty Git repository or reinitialize an existing one.
Package init git-init - Create an empty Git repository or reinitialize an existing one.
Package merge git-merge - Join two or more development histories together.
Package merge git-merge - Join two or more development histories together.
Package pull git-pull - Fetch from and integrate with another repository or a local branch.
Package pull git-pull - Fetch from and integrate with another repository or a local branch.
Package push git-push - Update remote refs along with associated objects.
Package push git-push - Update remote refs along with associated objects.
Package rebase git-rebase - Reapply commits on top of another base tip.
Package rebase git-rebase - Reapply commits on top of another base tip.
Package remote git-remote - Manage set of tracked repositories.
Package remote git-remote - Manage set of tracked repositories.
Package reset git-reset - Reset current HEAD to the specified state.
Package reset git-reset - Reset current HEAD to the specified state.
Package revparse git-rev-parse - Pick out and massage parameters.
Package revparse git-rev-parse - Pick out and massage parameters.
Package status git-status - Show the working tree status SYNOPSIS Reference: https://git-scm.com/docs/git-status git status [<options>...] [--] [<pathspec>...] DESCRIPTION Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index file, and paths in the working tree that are not tracked by Git (and are not ignored by gitignore(5)).
Package status git-status - Show the working tree status SYNOPSIS Reference: https://git-scm.com/docs/git-status git status [<options>...] [--] [<pathspec>...] DESCRIPTION Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index file, and paths in the working tree that are not tracked by Git (and are not ignored by gitignore(5)).
Package tag git-tag - git-tag - Create, list, delete or verify a tag object signed with GPG.
Package tag git-tag - git-tag - Create, list, delete or verify a tag object signed with GPG.
Package worktree git-worktree - Manage multiple working trees.
Package worktree git-worktree - Manage multiple working trees.

Jump to

Keyboard shortcuts

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