Permalink
Browse files

[lib] readme update

  • Loading branch information...
1 parent 0e494b1 commit a97d61fbff2e28612959f06fc1002ec939b69541 @0x00A committed with tmpvar Nov 7, 2012
Showing with 16 additions and 34 deletions.
  1. +16 −34 README.md
View
@@ -4,53 +4,35 @@
```js
var gitstream = require('git-stream')
-var repo = gitstream.Repo()
+var r = gitstream.Repo()
//
// get a repo from disk
//
-repo
- .read('./repoA')
- .on('end', function() {
-
- })
+// r.read('./repoA').pipe(r.push('origin', 'master'))
//
-// add an origin
+// add a remote
//
-repo.remote.add({
- name: 'origin',
- port: 8000,
- address: '127.0.0.1',
+r.remote.add({
+ name: 'origin',
+ branch: 'master',
+ port: 8000,
+ address: '127.0.0.1',
id: 'username/origin'
-});
-
-repo.remote.add({
- name: 'fork',
- port: 8000,
- address: '127.0.0.1',
- id: 'username/fork'
-});
-
-repo.pull('origin')
-
-repo
- .pull('fork')
- .on('conflict', function(conflicts) {
- console.dir(conflicts);
- process.exit(0);
- })
+})
-//
-// add some stuff to it
-//
-repo.add(fs.createReadStream('./README.md'))
+var file = fs.createReadStream('./README.md')
//
-// commit some stuff and push
+// add a file, commit it and push it to the remote
//
-repo.commit({ m: 'first commit!' }).push('origin')
+r.pull('origin')
+ .pipe(r.add(file))
+ .pipe(r.commit({ m: 'first commit!' }))
+ .pipe(r.push('origin'))
+
```
# As a server

0 comments on commit a97d61f

Please sign in to comment.