From 2a064a9d1bbb8de6ce489b685cce026eee167cd2 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 17 Mar 2020 22:48:49 +0000 Subject: deploy: fb719f52b73920fb18c7f3080ebb1fc73300be49 --- git.html | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'git.html') diff --git a/git.html b/git.html index 54ebae5..53227fa 100644 --- a/git.html +++ b/git.html @@ -81,7 +81,7 @@ @@ -149,15 +149,15 @@

git(1)

-

Misc

+

staging

  git add -p [<file>] ............ partial staging (interactive)
 
-

remote

+

Remote

  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

  git branch [-a] ................ list available branches; -a to include
                                    remote branches
   git branch -vv ................. list branch & annotate with head sha1 &
@@ -167,7 +167,7 @@
   git push -u origin <rbname> .... push branch to origin (or other remote), and
                                    setup <rbname> as tracking branch
 
-

resetting

+

Resetting

  git reset [opt] <ref|commit>
     opt:
       --mixed .................... resets index, but not working tree
@@ -179,25 +179,26 @@
   git reset --soft HEAD~1 ........ delete most recent commit but keep work
   git reset --hard HEAD~1 ........ delete most recent commit and delete work
 
-

tags

+

Tags

  git tag -a <tname> -m "descr" ........ creates an annotated tag (full object
                                          containing tagger, date, ...)
   git tag -l ........................... list available tags
   git checkout tag/<tname> ............. checkout specific tag
   git checkout tag/<tname> -b <bname> .. checkout specific tag in a new branch
 
-

diff

+

Diff

  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

  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

  git format-patch <opt> <since>/<revision range>
     opt:
       -N ................... use [PATCH] instead [PATCH n/m] in subject when
@@ -221,7 +222,7 @@
   # generate single patch file from a certain commit/ref
   git format-patch <COMMIT/REF> --stdout > my-patch.patch
 
-

submodules

+

Submodules

  git submodule add <url> [<path>] .......... add new submodule to current project
   git clone --recursive <url> ............... clone project and recursively all
                                               submodules (same as using
@@ -235,12 +236,12 @@
                                               origin/HEAD or a branch specified
                                               for the submodule
 
-

inspection

+

Inspection

  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

  HEAD ........ last commit
   HEAD~1 ...... last commit-1
   HEAD~N ...... last commit-N (linear backwards when in tree structure, check
@@ -259,7 +260,7 @@
                         
 
                         
-                            
                         
@@ -277,7 +278,7 @@
                 
 
                 
-                    
                 
-- 
cgit v1.2.3