Versions Compared

Key

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

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. This page familiarizes some of the useful git commands while dealing with RDK code base.

checkout

...

To switch to another branch in your local work environment.

$ git checkout BRANCH_NAME

...

Code Block
git rebase [-i | --interactive] [<options>] [--exec <cmd>] [--onto <newbase> | --keep-base] [<upstream> [<branch>]] 
git rebase [-i | --interactive] [<options>] [--exec <cmd>] [--onto <newbase>] --root [<branch>] 
git rebase (--continue | --skip | --abort | --quit | --edit-todo | --show-current-patch)


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.

...

Code Block
git stash list [<options>] 
git stash show [<options>] [<stash>]
git stash drop [-q|--quiet] [<stash>]
git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]
git stash branch <branchname> [<stash>]
git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet] [-u|--include-untracked] [-a|--all] [-m|--message <message>] [--] [<pathspec>…​]] 
git stash clear
git stash create [<message>]
git stash store [-m|--message <message>] [-q|--quiet] <commit>


Options :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. 

...