Documentation ¶
Overview ¶
Package git package contains functions to operate git repositories used by git-ghost
Index ¶
- Variables
- func AppendNonIndexedDiffFiles(dir, filepath string, nonIndexedFilepaths []string) errors.GitGhostError
- func ApplyDiffBundleFile(dir, filepath string) errors.GitGhostError
- func ApplyDiffPatchFile(dir, filepath string) errors.GitGhostError
- func CommitAndPush(dir, filename, message, committish string) errors.GitGhostError
- func CommitFile(dir, filename, message string) errors.GitGhostError
- func CopyUserConfig(srcDir, dstDir string) errors.GitGhostError
- func CreateDiffBundleFile(dir, filepath, fromCommittish, toCommittish string) errors.GitGhostError
- func CreateDiffPatchFile(dir, filepath, committish string) errors.GitGhostError
- func CreateOrphanBranch(dir, branch string) errors.GitGhostError
- func DeleteRemoteBranches(dir string, branchNames ...string) errors.GitGhostError
- func GetUserConfig(dir string) (string, string, errors.GitGhostError)
- func InitializeGitDir(dir, repo, branch string) errors.GitGhostError
- func ListRemoteBranchNames(repo string, branchnames []string) ([]string, errors.GitGhostError)
- func Pull(dir, committish string) errors.GitGhostError
- func Push(dir string, committishes ...string) errors.GitGhostError
- func ResetHardToBranch(dir, branch string) errors.GitGhostError
- func ResolveCommittish(dir, committish string) (string, errors.GitGhostError)
- func SetUserConfig(dir, name, email string) errors.GitGhostError
- func ValidateCommittish(dir, committish string) errors.GitGhostError
- func ValidateGit() errors.GitGhostError
- func ValidateRemoteBranchExistence(repo, branch string) (bool, errors.GitGhostError)
Constants ¶
This section is empty.
Variables ¶
var (
ORIGIN string = "origin"
)
Functions ¶
func AppendNonIndexedDiffFiles ¶
func AppendNonIndexedDiffFiles(dir, filepath string, nonIndexedFilepaths []string) errors.GitGhostError
AppendNonIndexedDiffFiles appends non-indexed diff files
func ApplyDiffBundleFile ¶
func ApplyDiffBundleFile(dir, filepath string) errors.GitGhostError
ApplyDiffBundleFile apply a patch file created in CreateDiffBundleFile
func ApplyDiffPatchFile ¶
func ApplyDiffPatchFile(dir, filepath string) errors.GitGhostError
ApplyDiffPatchFile apply a diff file created by CreateDiffPatchFile
func CommitAndPush ¶
func CommitAndPush(dir, filename, message, committish string) errors.GitGhostError
CommitAndPush commits and push to its origin
func CommitFile ¶
func CommitFile(dir, filename, message string) errors.GitGhostError
CommitFile commits a file
func CopyUserConfig ¶
func CopyUserConfig(srcDir, dstDir string) errors.GitGhostError
CopyUserConfig copies user config from source directory to destination directory.
func CreateDiffBundleFile ¶
func CreateDiffBundleFile(dir, filepath, fromCommittish, toCommittish string) errors.GitGhostError
CreateDiffBundleFile creates patches for fromCommittish..toCommittish and save it to filepath
func CreateDiffPatchFile ¶
func CreateDiffPatchFile(dir, filepath, committish string) errors.GitGhostError
CreateDiffPatchFile creates a diff from committish to current working state of `dir` and save it to filepath
func CreateOrphanBranch ¶
func CreateOrphanBranch(dir, branch string) errors.GitGhostError
CreateOrphanBranch creates an orphan branch on dir
func DeleteRemoteBranches ¶
func DeleteRemoteBranches(dir string, branchNames ...string) errors.GitGhostError
DeleteRemoteBranches delete branches from its origin
func GetUserConfig ¶
func GetUserConfig(dir string) (string, string, errors.GitGhostError)
GetUserConfig returns a user config (name and email) from destination directory.
func InitializeGitDir ¶
func InitializeGitDir(dir, repo, branch string) errors.GitGhostError
InitializeGitDir clone repo to dir. if you set empty branchname, it will checkout default branch of repo.
func ListRemoteBranchNames ¶
func ListRemoteBranchNames(repo string, branchnames []string) ([]string, errors.GitGhostError)
ListRemoteBranchNames returns remote branch names
func Pull ¶
func Pull(dir, committish string) errors.GitGhostError
Pull pulls committish from its origin
func Push ¶
func Push(dir string, committishes ...string) errors.GitGhostError
Push pushes current HEAD to its origin
func ResetHardToBranch ¶
func ResetHardToBranch(dir, branch string) errors.GitGhostError
ResetHardToBranch reset dir to branch with --hard option
func ResolveCommittish ¶
func ResolveCommittish(dir, committish string) (string, errors.GitGhostError)
ResolveCommittish resolves committish as full commit hash on dir
func SetUserConfig ¶
func SetUserConfig(dir, name, email string) errors.GitGhostError
SetUserConfig sets a user config (name and email) to destination directory.
func ValidateCommittish ¶
func ValidateCommittish(dir, committish string) errors.GitGhostError
ValidateCommittish check committish is valid on dir
func ValidateGit ¶
func ValidateGit() errors.GitGhostError
ValidateGit check the environment has 'git' command or not.
func ValidateRemoteBranchExistence ¶
func ValidateRemoteBranchExistence(repo, branch string) (bool, errors.GitGhostError)
ValidateRemoteBranchExistence checks repo has branch or not.
Types ¶
This section is empty.