git

package
v0.1.31 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package git is an interface package that provides Git functionality likely through a library package

Index

Constants

View Source
const (
	DefaultInitRemote = "origin"
)
View Source
const (
	DefaultRemoteOfInterest = "origin"
)

Variables

This section is empty.

Functions

func Clone

func Clone(cloneURL, localPath string) error

Clone does a `git clone` on the provided :cloneURL into the directory at :localPath. If the remote is a bare repository, a new repository will be initialised at :localPath with the `origin` remote set to :cloneURL

func Init

func Init(cloneURL, localPath string, defaultRemoteName ...string) error

Init does a `git init` on the provided :localPath using the clone URL :cloneURL as the initial remote. If :defaultRemoteName is specified, the first string in the expansion will be used as the remote name; if unspecified, 'origin' is used

Types

type Remote

type Remote struct {
	Name string
	URL  string
}

func GetRemote

func GetRemote(fromGitRepositoryAt string, remoteNameMatcher ...string) (*Remote, error)

GetRemote retrieves the remote from the Git repository located at the path :fromGitRepositoryAt which should be a directory containing a .git directory. If :remoteNameMatcher is specified, the URL returned will be the URL of the remote whose name matches with the specified matcher. If :remoteNameMatcher is not specified, the URL of origin is returned

Jump to

Keyboard shortcuts

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