Skip to content

Commit

Permalink
Add CreateBranch command (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bwko authored and lunny committed Jan 17, 2017
1 parent 7477742 commit 8a6974f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions repo_branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ func (repo *Repository) DeleteBranch(name string, opts DeleteBranchOptions) erro
return err
}

// CreateBranch create a new branch
func (repo *Repository) CreateBranch(branch, newBranch string) error {
cmd := NewCommand("branch")
cmd.AddArguments(branch, newBranch)

_, err := cmd.RunInDir(repo.Path)

return err
}

// AddRemote adds a new remote to repository.
func (repo *Repository) AddRemote(name, url string, fetch bool) error {
cmd := NewCommand("remote", "add")
Expand Down

0 comments on commit 8a6974f

Please sign in to comment.