Documentation ¶
Index ¶
- func GithubRepoURL(oauthToken, organization, repository string) string
- type Repository
- func (r *Repository) Clone(branch string) error
- func (r *Repository) CreateBranch(branch string) error
- func (r *Repository) CreateCommit(msg string, files []string) error
- func (r *Repository) FileChanged(relpath string) (bool, error)
- func (r *Repository) Push() error
- func (r *Repository) UpClone(branch string) error
- func (r *Repository) Update(branch string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GithubRepoURL ¶
GithubRepoURL returns a HTTPS url to acces the github repository with OAUTH authentication
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository represents a git repository
func NewGithubRepository ¶
func NewGithubRepository(oauthToken, organization, repository, localdirectory string) *Repository
NewGithubRepository initializes a github based repository object
func (*Repository) Clone ¶
func (r *Repository) Clone(branch string) error
Clone clones the git repository, the directory must not exist
func (*Repository) CreateBranch ¶
func (r *Repository) CreateBranch(branch string) error
CreateBranch creates a new branch
func (*Repository) CreateCommit ¶
func (r *Repository) CreateCommit(msg string, files []string) error
CreateCommit creates a commit
func (*Repository) FileChanged ¶
func (r *Repository) FileChanged(relpath string) (bool, error)
FileChanged returns true if the tracked filed contains non-committed changes
func (*Repository) Push ¶
func (r *Repository) Push() error
Push pushes the branch to the default remote
func (*Repository) UpClone ¶
func (r *Repository) UpClone(branch string) error
UpClone clones the repository if the directory does not exist yet otherwise updates it.
func (*Repository) Update ¶
func (r *Repository) Update(branch string) error
Update checksout the branch and updates it to the newest remote ref
Click to show internal directories.
Click to hide internal directories.