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
27 changes: 23 additions & 4 deletions aria/contents/docs/libra/command/rebase/index.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
---
title: The [rebase] Command
description:
description: reapply commits on top of another base
---

<Note type="warning" title="Warning">
**Currently, libra only supports fast-forward merge.**
</Note>
### Usage

libra rebase [OPTIONS] <UPSTREAM>

### Arguments

- <UPSTREAM> - The new "base" commit or branch. The commits from the current branch will be reapplied on top of this <UPSTREAM> commit.

### Description

​ Rebasing is the process of moving a sequence of commits to a new base commit. This command rewrites the project history by creating fresh commits that apply the same set of changes but from a different starting point.

### Example

\- libra rebase master
\- libra rebase <commit-hash>

<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>
3 changes: 3 additions & 0 deletions libra/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ enum Commands {
Commit(command::commit::CommitArgs),
#[command(about = "Switch branches")]
Switch(command::switch::SwitchArgs),
#[command(about = "Reapply commits on top of another base tip")]
Rebase(command::rebase::RebaseArgs),
#[command(about = "Merge changes")]
Merge(command::merge::MergeArgs),
#[command(about = "Reset current HEAD to specified state")]
Expand Down Expand Up @@ -122,6 +124,7 @@ pub async fn parse_async(args: Option<&[&str]>) -> Result<(), GitError> {
Commands::Branch(args) => command::branch::execute(args).await,
Commands::Commit(args) => command::commit::execute(args).await,
Commands::Switch(args) => command::switch::execute(args).await,
Commands::Rebase(args) => command::rebase::execute(args).await,
Commands::Merge(args) => command::merge::execute(args).await,
Commands::Reset(args) => command::reset::execute(args).await,
Commands::CherryPick(args) => command::cherry_pick::execute(args).await,
Expand Down
1 change: 1 addition & 0 deletions libra/src/command/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub mod log;
pub mod merge;
pub mod pull;
pub mod push;
pub mod rebase;
pub mod remote;
pub mod remove;
pub mod reset;
Expand Down
Loading
Loading