From 1f54bcb9b3d24ff5c23bbc69f221d7be061197b9 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 17 Mar 2020 20:49:49 +0100 Subject: updated git --- src/git.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/git.md b/src/git.md index 8036303..47c99e4 100644 --- a/src/git.md +++ b/src/git.md @@ -1,18 +1,18 @@ # git(1) -## Misc +## staging ```markdown git add -p [] ............ partial staging (interactive) ``` -## remote +## Remote ```markdown git remote -v .................. list remotes verbose (with URLs) git remote show [-n] .. list info for (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 as tracking branch ``` -## resetting +## Resetting ```markdown git reset [opt] opt: @@ -38,7 +38,7 @@ git reset --hard HEAD~1 ........ delete most recent commit and delete work ``` -## tags +## Tags ```markdown git tag -a -m "descr" ........ creates an annotated tag (full object containing tagger, date, ...) @@ -47,22 +47,23 @@ git checkout tag/ -b .. checkout specific tag in a new branch ``` -## diff +## Diff ```markdown git diff HEAD: origin/HEAD: ... diff files for different refs git diff -U$(wc -l ) ......... 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 .... show commit history + diffs for ``` -## patching +## Patching ```markdown git format-patch / opt: @@ -88,7 +89,7 @@ git format-patch --stdout > my-patch.patch ``` -## submodules +## Submodules ```markdown git submodule add [] .......... add new submodule to current project git clone --recursive ............... clone project and recursively all @@ -104,14 +105,14 @@ for the submodule ``` -## inspection +## Inspection ```markdown git ls-tree [-r] .... show git tree for , -r to recursively ls sub-trees git show ............ show git cat-file -p ..... print content of ``` -## revision_range +## Revision Specifier ```markdown HEAD ........ last commit HEAD~1 ...... last commit-1 -- cgit v1.2.3