Skip to content

Commit e091897

Browse files
committed
Update README.
1 parent c76753a commit e091897

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
## git-repo-info
22

3-
Retrieves repo information.
3+
Retrieves repo information without relying on the `git` command.
4+
5+
### Usage
6+
7+
```javascript
8+
var getRepoInfo = require('git-repo-info');
9+
10+
var info = getRepoInfo();
11+
12+
info.branch //=> will be the current branch
13+
info.sha //=> will be the current sha
14+
info.abbreviatedSha //=> will be the first 10 chars of the current sha
15+
```
16+
17+
When called without any arguments, `git-repo-info` will automatically lookup upwards
18+
into parent directories to find the first match with a `.git` folder.
19+
20+
If passed an argument, it will be assumed to be the path to the repo's `.git` folder
21+
to inspect.

0 commit comments

Comments
 (0)