deleteBranch
Delete a local branch
param | type [= default] | description |
---|---|---|
fs | FsClient | a file system implementation |
dir | string | The working tree directory path |
gitdir | string = join(dir,'.git') | The git directory path |
ref | string | The branch to delete |
return | Promise<void> | Resolves successfully when filesystem operations are complete |
Note: This only deletes loose branches - it should be fixed in the future to delete packed branches as well.
Example Code:
await git.deleteBranch({ fs, dir: '/tutorial', ref: 'local-branch' })
console.log('done')
Tip: If you need a clean slate, expand and run this snippet to clean up the file system.
window.fs = new LightningFS('fs', { wipe: true })
window.pfs = window.fs.promises
console.log('done')