RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
...
$ git checkout BRANCH_NAME |
Synopsis:
git checkout [-q] [-f] [-m] [<branch>]
...
git checkout (-p|--patch) [<tree-ish>] [--] [<pathspec>…]
Options:
--quiet
is specified.HEAD
. This is used to throw away local changes.<new_branch>
and start it at <start_point>
<new_branch>
and start it at <start_point>
; if it already exists, then reset it to <start_point>
. This is equivalent to running "git branch" with "-f".branch.autoSetupMerge
configuration variable is true.Examplechecks out the rdk-next branch.
$ git checkout rdk-next |
checks out the rdk-next branch.
add
To stage changes[file modifications and deletions].Accepts arguments for files or directories within the project directory.
$ git add |
Synopsis:
git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p] [--edit | -e] [--[no-]all | --[no-]ignore-removal | [--update | -u]] [--intent-to-add | -N] [--refresh]
[--ignore-errors] [--ignore-missing] [–renormalize] [--chmod=(+|-)x] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>…]
Options:
$ git add [options]
...
Example
$ git add Documentation/\*.txt |
Adds content from all *.txt
files under Documentation
directory and its subdirectories
...
.
...
commit
Consists of a snapshot of the directory structure and file contents for the entire project.Record changes to the repository.
$ git commit |
Synopsis: Synopsis
git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [–amend]
...
[-S[<keyid>]] [--] [<pathspec>…]
Options:
-c
the editor is invoked, so that the user can further edit the commit message.rebase --autosquash
. Example:
$ edit hello.c |
...
$ git branch [branch] |
Synopsis:
git branch [--color[=<when>] | --no-color] [--show-current] [-v [--abbrev=<length> | --no-abbrev]] [--column[=<options>] | --no-column] [--sort=<key>] [(--merged | --no-merged) [<commit>]] [--contains [<commit]] [--no-contains [<commit>]] [--points-at <object>] [--format=<format>] [(-r | --remotes) | (-a | --all)] [--list] [<pattern>…] git branch [--track | --no-track] [-f] <branchname> [<start-point>] git branch (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>] git branch --unset-upstream [<branchname>] git branch (-m | -M) [<oldbranch>] <newbranch> git branch (-c | -C) [<oldbranch>] <newbranch> git branch (-d | -D) [-r] <branchname>… git branch --edit-description [<branchname>]
Options:
--delete --force
.-f
, git branch refuses to change an existing branch.<pattern>...
, e.g. git branch --list 'maint-*'
, list only the branches that match the pattern(s).--list
to match optional pattern(s).Example:
creating a new git branch called “dev”
$$ git branch dev |
Deletedcreating a new git branch devcalled “dev”
$ git branch -d dev |
Deleted branch dev
merge
Merges [branch]
into current branch.
$ git merge [branch] |
Synopsis: Synopsis
git merge [-n] [--stat] [--no-commit] [--squash] [--[no-]edit] [--no-verify] [-s <strategy>] [-X <strategy-option>] [-S[<keyid>]] [--[no-]allow-unrelated-histories] [--[no-]rerere-autoupdate] [-m <msg>] [-F <file>] [<commit>…] git merge (--continue | --abort | --quit)
Options:
Shows diff of the unstaged changes.
...
$ git diff
Shows diff of the staged changes.
...
--no-overwrite-ignore
to abort.Example
$ git merge fixes enhancements |
Merge branches fixes
and enhancements
on top of the current branch, making an octopus merge.
Show changes between commits, commit and working tree, etc
$ git diff |
Synopsis
git diff [<options>] [<commit>] [--] [<path>…]
git diff [<options>] --cached [<commit>] [--] [<path>…]
git diff [<options>] <commit> <commit> [--] [<path>…]
git diff [<options>] <blob> <blob>
git diff [<options>] --no-index [--] <path> <path>
Options
--patch
. Implies -p
.Example
$ git diff (1) $ git diff --cached (2) $ git diff HEAD (3) |
Changes in the working tree not yet staged for the next commit.
Changes between the index and your last commit; what you would be committing if you run "git commit" without "-a" option.
Changes in the working tree since your last commit; what you would be committing if you run "git commit -a"
log
Shows the history of the current branch.
...