isomorphic-git

isomorphic-git

  • API Docs
  • Guide
  • Blog
  • GitHub
  • npm

›Files

All Commands

  • Alphabetical Index
  • Error Code Index

Repository

  • init
  • clone
  • commit
  • log
  • config
  • fetch
  • checkout
  • push
  • pull
  • merge
  • walkBeta1
  • verify

Files

  • add
  • remove
  • listFiles
  • status

Branches

  • currentBranch
  • branch
  • deleteBranch
  • listBranches

Tags

  • tag
  • annotatedTag
  • deleteTag
  • listTags

Remotes

  • getRemoteInfo
  • addRemote
  • deleteRemote
  • listRemotes

Plugins

  • credentialManager
  • emitter
  • fs
  • http
  • pgp

Plumbing Commands

  • findRoot
  • expandRef
  • expandOid
  • resetIndex
  • resolveRef
  • writeRef
  • deleteRef
  • readObject
  • writeObject
  • statusMatrix
  • isDescendent
  • indexPack

Misc Commands

  • version

Deprecated Commands

  • utils.auth
  • utils.oauth2
  • sign
Edit

add

Add a file to the git index (aka staging area)

paramtype [= default]description
fs [deprecated]FSModuleThe filesystem containing the git repo. Overrides the fs provided by the plugin system.
dir, gitdirstring, stringThe working tree directory path, and optionally the git directory path
filepathstringThe path to the file to add to the index
returnPromise<void>Resolves successfully once the git index has been updated
await new Promise((resolve, reject) => fs.writeFile(
  '$input((/README.md))',
  `$textarea((# TEST))`,
  (err) => err ? reject(err) : resolve()
))
await git.add({ dir: '$input((/))', filepath: '$input((README.md))' })
console.log('done')
← verifyremove →
isomorphic-git
Docs
Getting StartedAPI Reference
Community
User ShowcaseProject Chat
GitHub
More
In The NewsBlog
Ad