diff options
author | johannst <johannes.stoelp@gmail.com> | 2020-03-17 20:49:49 +0100 |
---|---|---|
committer | johannst <johannes.stoelp@gmail.com> | 2020-03-17 20:49:49 +0100 |
commit | 1f54bcb9b3d24ff5c23bbc69f221d7be061197b9 (patch) | |
tree | f73472c692db99ba4129944bf78c76b816dc0254 /src/git.md | |
parent | b4958ff7bdb8ccc500a0b47811f1ac1ea196bbe3 (diff) | |
download | notes-1f54bcb9b3d24ff5c23bbc69f221d7be061197b9.tar.gz notes-1f54bcb9b3d24ff5c23bbc69f221d7be061197b9.zip |
updated git
Diffstat (limited to 'src/git.md')
-rw-r--r-- | src/git.md | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -1,18 +1,18 @@ # git(1) -## Misc +## staging ```markdown git add -p [<file>] ............ partial staging (interactive) ``` -## remote +## Remote ```markdown git remote -v .................. list remotes verbose (with URLs) git remote show [-n] <remote> .. list info for <remote> (like remote HEAD, remote branches, tracking mapping) ``` -## branching +## Branching ```markdown git branch [-a] ................ list available branches; -a to include remote branches @@ -24,7 +24,7 @@ setup <rbname> as tracking branch ``` -## resetting +## Resetting ```markdown git reset [opt] <ref|commit> opt: @@ -38,7 +38,7 @@ git reset --hard HEAD~1 ........ delete most recent commit and delete work ``` -## tags +## Tags ```markdown git tag -a <tname> -m "descr" ........ creates an annotated tag (full object containing tagger, date, ...) @@ -47,22 +47,23 @@ git checkout tag/<tname> -b <bname> .. checkout specific tag in a new branch ``` -## diff +## Diff ```markdown git diff HEAD:<fname> origin/HEAD:<fname> ... diff files for different refs git diff -U$(wc -l <fname>) <fname> ......... shows complete file with diffs instead of usual diff snippets ``` -## log +## Log ```markdown git log --oneline .... shows log in single line per commit -> alias for '--pretty=oneline --abbrev-commit' git log --graph ...... text based graph of commit history git log --decorate ... decorate log with REFs + git log -p <file> .... show commit history + diffs for <file> ``` -## patching +## Patching ```markdown git format-patch <opt> <since>/<revision range> opt: @@ -88,7 +89,7 @@ git format-patch <COMMIT/REF> --stdout > my-patch.patch ``` -## submodules +## Submodules ```markdown git submodule add <url> [<path>] .......... add new submodule to current project git clone --recursive <url> ............... clone project and recursively all @@ -104,14 +105,14 @@ for the submodule ``` -## inspection +## Inspection ```markdown git ls-tree [-r] <ref> .... show git tree for <ref>, -r to recursively ls sub-trees git show <obj> ............ show <obj> git cat-file -p <obj> ..... print content of <obj> ``` -## revision_range +## Revision Specifier ```markdown HEAD ........ last commit HEAD~1 ...... last commit-1 |