cmd

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckoutHead

func CheckoutHead() *exec.Cmd

CheckoutHead returns command git checkout -qf FETCH_HEAD

func DeepenedFetch

func DeepenedFetch(remoteName, ref string) *exec.Cmd

DeepenedFetch deepens the fetch history. It is similar with Fetch but accepts 500 more commit history than last Fetch operation by --deepen=500 option. e.g. git fetch origin +refs/heads/onboarding --deepen=500

func Fetch

func Fetch(remoteName, ref string) *exec.Cmd

Fetch fetches changes by ref, ref can be a tag, branch or pr. --depth=1 is used to limit fetching to the last commit from the tip of each remote branch history. e.g. git fetch origin +refs/heads/onboarding --depth=1

func Gc

func Gc() *exec.Cmd

SetConfig returns command: git config --global $KEY $VA e.g. git config --global user.name username

func InitGit

func InitGit(dir string) *exec.Cmd

InitGit creates an empty git repository. it returns command git init

func Merge

func Merge(branch string) *exec.Cmd

Merge merge a branch e.g. git merge demo

func RemoteAdd

func RemoteAdd(remoteName, remote string) *exec.Cmd

RemoteAdd sets the remote origin for the repository.

func RemoteRemove

func RemoteRemove(remoteName string) *exec.Cmd

RemoteRemove removes the remote origin for the repository.

func ResetMerge

func ResetMerge() *exec.Cmd

ResetMerge reset last merge It return command git reset --merge

func SetConfig

func SetConfig(key, value string) *exec.Cmd

SetConfig returns command: git config --global $KEY $VA e.g. git config --global user.name username

func ShowLastLog

func ShowLastLog() *exec.Cmd

ShowLastLog returns command git --no-pager log --oneline -1 It shows last commit messge with sha

func UpdateSubmodules

func UpdateSubmodules() *exec.Cmd

UpdateSubmodules returns command: git submodule update --init --recursive

Types

type Command

type Command struct {
	Cmd *exec.Cmd
	// DisableTrace display command args
	DisableTrace bool
	// IgnoreError ingore command run error
	IgnoreError bool
}

Command ...

Jump to

Keyboard shortcuts

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