Documentation
¶
Index ¶
- func Add() error
- func AddRemote(repoDir, remoteName, url string) error
- func Clone(url, targetDir string) error
- func Commit(message string) error
- func GetCurrentGithubUser() (string, error)
- func GetRemoteURL() (string, error)
- func GetRemoteURLFromDir(dir string) (string, error)
- func GetRepoRoot() (string, error)
- func HasUncommittedChanges() (bool, error)
- func IsGitRepository() bool
- func Pull(repoDir string) error
- func Push(repoDir string) error
- func PushToMain() error
- func RemoveRemote(repoDir, remoteName string) error
- type RemoteInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentGithubUser ¶ added in v0.2.11
GetCurrentGithubUser attempts to retrieve the GitHub username of the current user by checking SSH authentication and git configuration.
func GetRemoteURL ¶
GetRemoteURL retrieves the git remote URL from the current directory
func GetRemoteURLFromDir ¶ added in v0.1.1
GetRemoteURLFromDir retrieves the git remote URL from the specified directory. If dir is empty, it uses the current directory.
func GetRepoRoot ¶
GetRepoRoot returns the root directory of the git repository
func HasUncommittedChanges ¶ added in v0.1.2
HasUncommittedChanges checks if there are uncommitted changes in the repository
func IsGitRepository ¶ added in v0.1.2
func IsGitRepository() bool
IsGitRepository checks if the current directory is a git repository
func PushToMain ¶ added in v0.1.2
func PushToMain() error
PushToMain pushes commits to the remote repository on main branch
func RemoveRemote ¶
RemoveRemote removes a git remote
Types ¶
type RemoteInfo ¶
RemoteInfo contains parsed information from a git remote URL
func ParseRemoteURL ¶
func ParseRemoteURL(remoteURL string) (*RemoteInfo, error)
ParseRemoteURL parses a git remote URL and extracts the owner and repository name Supports formats: - SSH: git@github.com:owner/repo.git - HTTPS: https://github.com/owner/repo.git - HTTPS (no .git): https://github.com/owner/repo