Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions aria/contents/docs/libra/command/add/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,33 @@
title: The [add] Command
description:
---

# add

**Add file contents to the index**

### Usage

libra add \[OPTIONS\] \[PATHSPEC\]...

### Arguments

- `[PATHSPEC]...` - Files & dirs to add content from

### Description

This command updates the index using the current content found in the working tree, to prepare the content staged for the next commit.

### Options

- `-A`, `--all`
Update the index not only where the working tree has a file matching pathspec but also where the index already has an entry.
This adds, modifies, and removes index entries to match the working tree.

If no pathspec is given when `-A` option is used, all files in the entire working tree are updated

- `-u`, `--update`
Update the index just where it already has an entry matching **pathspec**. This removes as well as modifies index entries to match the working tree, but adds no new files

- `-v`, `--verbose`
more detailed output
40 changes: 40 additions & 0 deletions aria/contents/docs/libra/command/branch/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,43 @@
title: The [branch] Command
description:
---

# branch

**List, create, or delete branches**

### Usage

libra branch [OPTIONS] [NEW_BRANCH] [COMMIT_HASH]

### Arguments

- `[NEW_BRANCH]` - New branch name
- `[COMMIT_HASH]` - Base branch name or commit hash

### Description

If --list is given, or if there are no non-option arguments, existing local branches are listed; the current branch will be highlighted in green and marked with an asterisk, same as git.

If a new branch name is given, a new branch is created that points to the given commit hash. If no commit hash is given, the new branch will point to the current commit.

### Options

- `-l`, `--list`
List all branches, don't include remote branches. The order is not guaranteed, mostly it is sorted by the created order.
- `-D`, `--delete <DELETE>`
Force delete branch
- `-u`, `--set-upstream-to <SET_UPSTREAM_TO>`
Set up `<branchname>`'s tracking information so `<upstream>` is considered `<branchname>`'s upstream branch.
- `--show-current`
Show current branch
- `-r`, `--remotes`
Show remote branches
- `-h`, `--help`
Print help

<Note type="note" title="Note">
All parameters should align with Git’s behavior as closely as possible, but
there may be some differences. Refs https://git-scm.com/docs/git-branch for
more information.
</Note>
27 changes: 27 additions & 0 deletions aria/contents/docs/libra/command/clone/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,30 @@
title: The [clone] Command
description:
---

# clone

**Clone a repository into a new directory**

### Usage

libra clone `<REMOTE_REPO>` [LOCAL_PATH]

### Arguments

- `<REMOTE_REPO>` - The remote repository location to clone from, current only support HTTP/HTTPS.
- `[LOCAL_PATH]` - The local path to clone the repository to. If not provided, the repository will be cloned to the current directory.

### Description

Clones a repository into a newly created directory, creates remote-tracking branches for each branch in the cloned repository , and creates and checks out an initial branch that is forked from the cloned repository’s currently active branch.

### Options

- `-h`, `--help` Print help

<Note type="note" title="Note">
Currently, libra only support clone from HTTP/HTTPS. SSH & Local path will
be supported in the future. git clone support more protocols and options,
refs https://git-scm.com/docs/git-clone for more information.
</Note>
32 changes: 32 additions & 0 deletions aria/contents/docs/libra/command/commit/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,35 @@
title: The [commit] Command
description:
---

# commit

**Record changes to the repository**

### Usage

libra commit [OPTIONS] --message \<MESSAGE\>

### Description

Create a new commit containing the current contents of the index and the given log message describing the changes. The new commit is a direct child of HEAD, usually the current head of the current branch, or a single commit hash (detached HEAD).

The content to be committed can be specified only by `libra add` & `libra rm` commands. (The git support other ways to add content to the index, for example, `--all` option in `git commit`, which is not supported in libra yet.)

If the `--allow-empty` option is not given, the commit will be aborted if the index is empty.

### Options:

- `-m`, `--message <MESSAGE>`
- `--allow-empty`
Allow commit with empty index.
- `--conventional`
Check if the commit message is conventional format, if not, the commit will be aborted.
- `-h`, `--help` Print help

<Note type="note" title="Note">
The commit message should align with Git’s behavior as closely as possible, excpet the `--conventional` option, which is not supported in Git. Refs https://git-scm.com/docs/git-commit for more information.

The `--conventional` option's format is based on the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.

</Note>
43 changes: 43 additions & 0 deletions aria/contents/docs/libra/command/diff/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,46 @@
title: The [diff] Command
description:
---

# diff

**Show different between files**

### Usage

libra diff [OPTIONS] [PATHSPEC]...

### Arguments

- `[PATHSPEC]` - File or directory name with a path relative to current directory or a absolute path

### Description

Show changes between the working tree and the index or a tree, changes between the index and a tree, changes between two trees.

If no arguments are given, the changes between the working tree and the index are shown. If the index don't have any changes, the changes between the working tree and the HEAD are shown.

PATHSPEC can be a file or directory name with a path relative to current directory or a absolute path. (The git support relative path start from the repository root, which is not supported in libra yet.). Because what's you are diff may not in disk currently, libra didn't check if the path exists.

{" "}

<Note type="note" title="Note">
The diff command use `less` to show the result in unix-like system, and
simply print all the content in windows. If you are using unix-like system,
you need to ensure `less` is installed (usually it is installed by default).
</Note>

### Options

### Options:

- `--old <COMMIT>` Old branch/commit, defaults is staged or HEAD
- `--new <COMMIT>` New branch/commit, default is working directory
- `--staged` Use stage as new commit. This option is conflict with --new.
- `--output <FILENAME>` Print the result to a file
- `-h`, `--help` Print help

<Note type="note" title="Note">
Because of the `clap`'s limitation, the `diff` command's options are
different from git's `diff` command.
</Note>
33 changes: 33 additions & 0 deletions aria/contents/docs/libra/command/fetch/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,36 @@
title: The [fetch] Command
description:
---

# fetch

**Download objects and refs from another repository**

### Usage

libra fetch [OPTIONS] [REPOSITORY] [REFSPEC]

### Arguments

- `[REPOSITORY]` - Repository to fetch from
- `[REFSPEC]` - Refspec to fetch, usually a branch name

### Description

Fetch branches from one or more other repositories, along with the objects necessary to complete their histories. Remote-tracking branches are updated.

When no remote is specified, by default the current branch's config remote is used (normally `origin`). If the current branch is not associated with a remote, the command fails.

`fetch` is automatically invoked by `libra pull` and `libra push`.

### Options

- `-a`, `--all`
Fetch all remotes
- `-h`, `--help`

<Note type="note" title="Note">
Git-fetch could also be used be fetch tags, but currently, libra didn't
support tag. Simple usage is same as git-fetch. Refs
https://git-scm.com/docs/git-fetch for more information.
</Note>
24 changes: 24 additions & 0 deletions aria/contents/docs/libra/command/index-pack/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,27 @@
title: The [index-pack] Command
description:
---

# index-pack

**Build pack index file for an existing packed archive**

### Usage

libra index-pack \[OPTIONS\] \<PACK_FILE\>

### Arguments

- `<PACK_FILE>` - Pack file path

### Description

Build pack index file for an existing packed archive.

### Options

- `-o`, `--output <INDEX_FILE>`<br/>
output index file path. Without this option the name of pack index file is constructed from the name of packed archive file by replacing `.pack` with `.idx`

- `--index-version <INDEX_VERSION>`<br/>
This is intended to be used by the test suite only. It allows to force the version for the generated pack index
17 changes: 17 additions & 0 deletions aria/contents/docs/libra/command/init/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,20 @@
title: The [init] Command
description:
---

# init

**Create an empty Libra repository**

### Usage

libra init

### Description

This command creates the necessary directories and files for a new Libra repository.
It also sets up the database and the initial configuration.

### Options

- `-h`, `--help` Print help
54 changes: 54 additions & 0 deletions aria/contents/docs/libra/command/lfs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,57 @@
title: The [lfs] Command
description:
---

# lfs

**Work with large files in Libra repositories**

### Usage

libra lfs \<COMMAND\> \[\<args\>\]

### Description

Libra LFS is a system for managing and versioning large files in association with a Libra repository.

Instead of storing the large files within the Libra repository as blobs, Libra LFS stores special "pointer files" in the repository,
while storing the actual file contents on an LFS server.

The contents of the large file are downloaded automatically when needed, for example when a branch containing the large file is checked out.

### Commands
#### track \[PATTERN\]...
View or add LFS paths to Libra Attributes (root)<br/>
Start tracking the given patterns(s) through Libra LFS. The argument is
written to .libra_attributes. If no paths are provided, simply list the
currently-tracked paths.<br/>
Like: `libra lfs track "*.png"`

#### untrack \<PATTERN\>...
Remove LFS paths from Libra Attributes (root).<br/>
Stop tracking the given pattern(s) through Libra LFS.<br/>
Nothing will happen if the pattern is not currently being tracked (in .libra_attribute).

#### locks
List currently "locked" files from the Libra LFS server.<br/>

#### lock \<PATH\>
Set a file as "locked" on the Libra LFS server.<br/>
String path name of the locked file. This should be relative to the root of the repository working directory.<br/>
Once locked, LFS will verify that Git pushes do not modify files locked by other users.

#### unlock \<PATH\>
Remove a "locked" file from the Libra LFS server.<br/>
##### Options
- `-f`, `--force` - Tells the server to remove the lock, even if it's owned by another user.
- `-i <ID>`, `--id <ID>` - Specifies a lock by its ID instead of path.

#### ls-files
Show information about Libra LFS files in the index and working tree.<br/>

<Note type="note" title="Note">
The `lfs` command only support root level tracking, and the root `.libra_attributes` file is used to store the tracking information.

Libra LFS is mainly designed for monorepo, which has different LFS server discovery mechanism from git-lfs.
However, it made special support for GitHub and Gitee.
</Note>
30 changes: 30 additions & 0 deletions aria/contents/docs/libra/command/log/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,33 @@
title: The [log] Command
description:
---

# log

**Show commit logs**

### Usage

libra log [OPTIONS]

### Description

List commits that are reachable by current local branch. The order is from the latest to the oldest. The commit hash, author, date, and commit message will be shown.

{" "}
<Note type="note" title="Note">
The log command use `less` to show the result in unix-like system, and
simply print all the content in windows. If you are using unix-like system,
you need to ensure `less` is installed (usually it is installed by default).
</Note>

### Options:

- `-n`, `--number <NUMBER>`
Limit the number of output
- `-h`, `--help`
Print help

<Note type="note" title="Note">
The order of the commits maybe different from Git's behavior.
</Note>
22 changes: 22 additions & 0 deletions aria/contents/docs/libra/command/merge/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,25 @@
title: The [merge] Command
description:
---

# merge

**Merge changes**

### Usage

libra merge `<BRANCH>`

### Arguments

- `<BRANCH>` - Branch name or commit hash, could be a local branch, remote branch or a commit hash.

### Description

Incorporates changes from the named commits. The `<BRANCH>` could be a branch name (local or remote) or a commit hash.

**Currently, libra only supports fast-forward merge.**

### Options:

- `-h`, `--help` Print help
Loading