Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Reapply commits on top of another base tip.

$ git rebase [options]

Options :

  • -i , --interactive : Make a list of the commits which are about to be rebased. Let the user edit that list before rebasing.
  • --continue  : Restart the rebasing process after having resolved a merge conflict.
  • --abort :Abort the rebase operation and reset HEAD to the original branch.
  • --quit : Abort the rebase operation but HEAD is not reset back to the original branch. The index and working tree are also left unchanged as a result.
  • --onto <newbase> : Starting point at which to create the new commits. If the --onto option is not specified, the starting point is <upstream>. May be any valid commit, and not just an existing branch name.
  • --skip  : Restart the rebasing process by skipping the current patch.
  • --edit-todo : Edit the todo list during an interactive rebase.
  • -m ,–merge  :Use merging strategies to rebase. When the recursive (default) merge strategy is used, this allows rebase to be aware of renames on the upstream side.
  • --show-current-patch  :Show the current patch in an interactive rebase or when rebase is stopped because of conflicts. This is the equivalent of git show REBASE_HEAD.

stash

Stash the changes in a dirty working directory away.when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.

Options :

  • list [<options>] : List the stash entries that you currently have. Eachstash entryis listed with its name (e.g.stash@{0}is the latest entry,stash@{1}is the one before, etc.),
  • show [<options>] [<stash>] :  Show the changes recorded in the stash entry as a diff between the stashed contents and the commit back when the stash entry was first created.
  • drop [-q|--quiet] [<stash>]  :  Remove a single stash entry from the list of stash entries. When no<stash>is given, it removes the latest one. i.e.stash@{0}, otherwise<stash>must be a valid stash log reference of the formstash@{<revision>}.
  • branch <branchname> [<stash>] : Creates and checks out a new branch named<branchname>starting from the commit at which the<stash>was originally created, applies the changes recorded in<stash>to the new working tree and index. If that succeeds, and<stash>is a reference of the formstash@{<revision>}, it then drops the<stash>. When no<stash>is given, applies the latest one.
  • clear : Removes all the stash entries
  • create : Create a stash entry (which is a regular commit object) and return its object name, without storing it anywhere in the ref namespace.
  • store  :Store a given stash created via git stash create (which is a dangling merge commit) in the stash ref, updating the stash reflog.