addRemote
Add or update a remote
param | type [= default] | description |
---|---|---|
fs | FsClient | a file system implementation |
dir | string | The working tree directory path |
gitdir | string | The git directory path |
remote | string | The name of the remote |
url | string | The URL of the remote |
force | boolean = false | Instead of throwing an error if a remote named remote already exists, overwrite the existing remote. |
return | Promise<void> | Resolves successfully when filesystem operations are complete |
Example Code:
await git.addRemote({
fs,
dir: '/tutorial',
remote: 'upstream',
url: 'https://github.com/isomorphic-git/isomorphic-git'
})
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')