go_git_cmd_wrapper

package module
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

README

Go Git Cmd Wrapper

Build Status PkgGoDev Go Report Card

Sponsor

It's a simple wrapper around git command.

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

// clone
output, err := git.Clone(clone.Repository("https://github.com/ldez/prm"))
// with debug option
output, err := git.Clone(clone.Repository("https://github.com/ldez/prm"), git.Debug)
output, err := git.Clone(clone.Repository("https://github.com/ldez/prm"), 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/prm"))

More examples: Documentation

Documentation

Overview

Package go_git_cmd_wrapper A simple wrapper around `git` command.

import (
	// ...
	"github.com/ldez/go-git-cmd-wrapper/v2/git"
	// ...
	"github.com/ldez/go-git-cmd-wrapper/v2/clone"
	"github.com/ldez/go-git-cmd-wrapper/v2/config"
	"github.com/ldez/go-git-cmd-wrapper/v2/fetch"
	"github.com/ldez/go-git-cmd-wrapper/v2/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.
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 lsfiles git-ls-files - Show information about files in the index and the working tree.
Package lsfiles git-ls-files - Show information about files in the index and the working tree.
Package merge git-merge - Join two or more development histories together.
Package merge git-merge - Join two or more development histories together.
Package notes git-notes - Add or inspect object notes.
Package notes git-notes - Add or inspect object notes.
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 stash git-stash - Stash the changes in a dirty working directory away.
Package stash git-stash - Stash the changes in a dirty working directory away.
Package status git-status - Show the working tree status
Package status git-status - Show the working tree status
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