Skip to content

Commit

Permalink
update getting started
Browse files Browse the repository at this point in the history
  • Loading branch information
nasdf committed Mar 2, 2021
1 parent 501c970 commit 8bb4c0d
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 30 deletions.
26 changes: 3 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Multiverse

[![Gitter](https://badges.gitter.im/multiverse-vcs/community.svg)](https://gitter.im/multiverse-vcs/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Go Report Card](https://goreportcard.com/badge/github.com/multiverse-vcs/go-multiverse)](https://goreportcard.com/report/github.com/multiverse-vcs/go-multiverse)
[![codecov](https://codecov.io/gh/multiverse-vcs/go-multiverse/branch/master/graph/badge.svg?token=Y6UBYBD56P)](https://codecov.io/gh/multiverse-vcs/go-multiverse)

> A decentralized version control system for peer-to-peer software development.
Expand All @@ -10,13 +9,13 @@

### Features

- ***Peer-to-peer*** - self host your repositories
- ***Works offline*** - integrated local code viewer
- ***Peer-to-Peer*** - self host your repositories
- ***Works Offline*** - internet connection optional
- ***Private & Secure*** - all communications are encrypted

### Getting Started

[Read the manual](https://www.multiverse-vcs.com/docs/).
[Read the manual](docs/getting-started.md).

### Building

Expand All @@ -28,25 +27,6 @@ $ cd go-multiverse
$ make install
```

### Usage

```
USAGE:
multi [global options] command [command options] [arguments...]
COMMANDS:
branch List, create, or delete branches
commit Record changes
daemon Starts a client
import Import a repo
init Create a repo
log Print repo history
merge Merge commits
status Print changes
tag List, create, or delete tags
help, h Shows a list of commands or help for one command
```

### Contributing

Found a bug or have a feature request? [Open an issue](https://github.com/multiverse-vcs/go-multiverse/issues/new).
Expand Down
67 changes: 66 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,73 @@ Multiverse uses peer-to-peer network protocols to exchange data.

Instead of using a centralized server, every participant runs a peer node.

Running a peer node is simple and requires no extra setup.
Start your peer node and keep it running in a separate terminal.

```bash
$ multi daemon
```

With the peer node up and running you are ready to create your first repository.

Create an empty directory and initialize the repository.

```bash
$ mkdir my_project
$ cd my_project
$ multi init
```

After you have made some changes check the repository status.

Notice that all files are tracked by default.

```bash
$ multi status
```

Once you are happy with your work, commit the changes to the repository.

A commit contains a snapshot of the files in your repository.

```bash
# describe your changes with an optional message
$ multi commit --message "add initial code"
```

To share your code with others create a new repository on the peer node.

Ensure there is no confidential info. Everything shared on the main network is public.

```bash
$ multi repo create my_project
```

If the repository was created successfully its remote path will be printed.

```bash
# your remote path will be different than this one
12D3KooWFRfidCtkUkViUMTnoEoVtzDLmdCix8XUmVCoZcATLixG/my_project
```

A remote path is how your repository is uniquely identified on the Multiverse network.

The remote path consists of your unique peer identifier followed by the repository name.

To push changes to the new remote repository, first add the remote to the repository.

```bash
# replace the remote path with your unique remote path
multi remote create origin 12D3KooWFRfidCtkUkViUMTnoEoVtzDLmdCix8XUmVCoZcATLixG/my_project
```

Next set the branch remote to the one created above.

```bash
multi branch set remote origin
```

Finally push the changes.

```bash
multi push
```
3 changes: 3 additions & 0 deletions pkg/command/repo/create.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package repo

import (
"fmt"

"github.com/multiverse-vcs/go-multiverse/pkg/rpc"
"github.com/multiverse-vcs/go-multiverse/pkg/rpc/repo"
"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -30,6 +32,7 @@ func NewCreateCommand() *cli.Command {
return err
}

fmt.Println(reply.Remote)
return nil
},
}
Expand Down
8 changes: 2 additions & 6 deletions pkg/command/repo/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ func NewListCommand() *cli.Command {
return err
}

fmt.Println("")
fmt.Printf("Name%28sCID\n", "")
fmt.Printf("----%28s---\n", "")

for name, id := range reply.Author.Repositories {
fmt.Printf("%-32s%s\n", name, id.String())
for name := range reply.Author.Repositories {
fmt.Printf("%s/%s\n", reply.PeerID.Pretty(), name)
}

return nil
Expand Down

0 comments on commit 8bb4c0d

Please sign in to comment.