If the branch already exists it will check out that branch. Otherwise, it will create a new remote tracking branch set to track the remote branch of that name.
Returns
Resolves successfully when filesystem operations are complete.
Example
// switch to the main branch awaitcheckout({ fs, dir:'/tutorial', ref:'main' })
Example
// restore the 'docs' and 'src/docs' folders to the way they were, overwriting any changes awaitcheckout({ fs, dir:'/tutorial', force:true, filepaths: ['docs', 'src/docs'] })
Example
// restore the 'docs' and 'src/docs' folders to the way they are in the 'develop' branch, overwriting any changes awaitcheckout({ fs, dir:'/tutorial', ref:'develop', noUpdateHead:true, force:true, filepaths: ['docs', 'src/docs'] })
Checkout a branch.
If the branch already exists it will check out that branch. Otherwise, it will create a new remote tracking branch set to track the remote branch of that name.
Returns
Resolves successfully when filesystem operations are complete.
Example
Example
Example