RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
Provide details about Repo & Git commands
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.
To switch to another branch in your local work environment.
$ git checkout BRANCH_NAME |
add
To stage changes[file modifications and deletions].Accepts arguments for files or directories within the project directory.
$ git add |
Options:
$ git add [options]
Examples:
Adds content from all all *.txt
files under Documentation
directory files under Documentation
directory and its subdirectories.
$ git add Documentation/\*.txt |
commit
Consists of a snapshot of the directory structure and file contents for the entire project.Record changes to the repository.
$ git commit |
Options:
-c
the the editor is invoked, so that the user can further edit the commit message.rebase --autosquash
. To view a list of existing branches
$ git branch |
Creates a new topic branch
$ git branch [branch] |
Merges Merges [branch]
into into current branch.
$ git merge [branch] |
Shows diff of the unstaged changes.
$ git diff |
Shows diff of the staged changes.
$ git diff --cached |
log
Shows the history of the current branch.
$ git log |
Shows the commits that aren't pushed.
$ git log m/[codeline].. |
Reapply commits on top of another base tip.
$ git rebase [options] |
$ 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 :
git show REBASE_HEAD
.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.
$ 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 :
stash@{0}
is the latest entry,stash@{1}
is the one before, etc.),<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>}
.<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.