在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:atom/git-utils开源软件地址:https://github.com/atom/git-utils开源编程语言:JavaScript 47.9%开源软件介绍:Git Node moduleHelpers for working with Git repositories built natively on top of libgit2. Installingnpm install git-utils Development
Docsgit.open(path, [search = true])Open the repository at the given path. This will return
git = require 'git-utils'
repository = git.open('/Users/me/repos/node') The opened repository will have a If search is set to true (the default), all paths up to the filesystem root will be recursively checked to try and find the root directory of a repository. If a search is false, traversing not be performed, and a repository will only be returned if the given path is the root of a repository. Repository.checkoutHead(path)Restore the contents of a path in the working directory and index to the
version at HEAD. Similar to running
Returns Repository.checkoutReference(reference, [create])Checks out a branch in your repository.
Returns Repository.getAheadBehindCount(branch)Get the number of commits the branch is ahead/behind the remote branch it
is tracking. Similar to the commit numbers reported by
Returns an object with Repository.getCommitCount(fromCommit, toCommit)Get the number of commits between
Returns the number of commits between the two, always >= 0. Repository.getConfigValue(key)Get the config value of the given key.
Returns the configuration value, may be Repository.setConfigValue(key, value)Get the config value of the given key.
Returns Repository.getDiffStats(path)Get the number of lines added and removed comparing the working directory contents of the given path to the HEAD version of the given path.
Returns an object with Repository.getHeadBlob(path)Get the blob contents of the given path at HEAD. Similar to
Returns the string contents of the HEAD version of the path. Repository.getHead()Get the reference or SHA-1 that HEAD points to such as Returns the string reference name or SHA-1. Repository.getIndexBlob(path)Get the blob contents of the given path in the index. Similar to
Returns the string contents of the index version of the path. Repository.getLineDiffs(path, text, [options])Get the line diffs comparing the HEAD version of the given path and the given text.
Returns an array of objects that have Repository.getLineDiffDetails(path, text, [options])Get the line diff details comparing the HEAD version of the given path and the given text. Takes the same arguments as Returns an array of objects which represent an old or new line in a diff. Every
object has Repository.getMergeBase(commit1, commit2)Get the merge base of two commits.
Returns the string SHA-1 of the merge base of Repository.getPath()Get the path of the repository. Returns the string absolute path of the opened repository. Repository.getReferences()Gets all the local and remote references. Returns an object with three keys: Repository.getReferenceTarget(ref)Get the target of the given reference.
Returns the string target of the given reference. Repository.getShortHead()Get a possibly shortened version of value returns by Returns a string shortened reference name or SHA-1. Repository.getStatus([path])Get the status of a single path or all paths in the repository. This will not include ignored paths.
Returns an integer status number if a path is specified and returns an object with path keys and integer status values if no path is specified. Repository.getUpstreamBranch([branch])Get the upstream branch of the given branch.
Returns the string upstream branch reference name. Repository.getWorkingDirectory()Get the working directory of the repository. Returns the string absolute path to the repository's working directory. Repository.isIgnored(path)Get the ignored status of a given path.
Returns Repository.isPathModified(path)Get the modified status of a given path.
Returns Repository.isPathNew(path)Get the new status of a given path.
Returns Repository.isPathDeleted(path)Get the deleted status of a given path.
Returns Repository.isPathStaged(path)Get the staged status of a given path.
Returns Repository.isStatusIgnored(status)Check if a status value represents an ignored path.
Returns Repository.isStatusModified(status)Check if a status value represents a modified path.
Returns Repository.isStatusNew(status)Check if a status value represents a new path.
Returns Repository.isStatusDeleted(status)Check if a status value represents a deleted path.
Returns Repository.isStatusStaged(status)Check if a status value represents a changed that is staged in the index.
Returns Repository.isSubmodule(path)Check if the path is a submodule in the index.
Returns Repository.refreshIndex()Reread the index to update any values that have changed since the last time the index was read. Repository.relativize(path)Relativize the given path to the repository's working directory.
Returns a repository-relative path if the given path is prefixed with the repository's working directory path. Repository.isWorkingDirectory(path)Is the given path the repository's working directory? It is better to call this method than comparing a path directly against
the value of
Returns Repository.release()Release the repository and close all file handles it has open. No other methods
can be called on the Repository.submoduleForPath(path)Get the repository for the submodule that the path is located in.
Returns a Repository.add(path)Stage the changes in
Raises an |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论