tag
Create a lightweight tag
param | type [= default] | description |
---|---|---|
fs | FsClient | a file system client |
dir | string | The working tree directory path |
gitdir | string = join(dir,'.git') | The git directory path |
ref | string | What to name the tag |
object | string = 'HEAD' | What oid the tag refers to. (Will resolve to oid if value is a ref.) By default, the commit object which is referred by the current HEAD is used. |
force | boolean = false | Instead of throwing an error if a tag named ref already exists, overwrite the existing tag. |
return | Promise<void> | Resolves successfully when filesystem operations are complete |
Example Code:
await git.tag({ fs, dir: '/tutorial', ref: 'test-tag' })
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')