User Tools

Site Tools


git_fsck

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
git_fsck [2019/03/02 07:59]
rpjday [SYNOPSIS]
git_fsck [2019/03/12 15:21] (current)
rpjday [Overview]
Line 1: Line 1:
 ===== Overview ===== ===== Overview =====
  
-Using ''​git fsck''​ to display dangling and unreachable objects.+Using ''​git fsck''​ to display dangling and unreachable objects ​(should cover reflog first). 
 + 
 +Check: 
 + 
 +  * Does ''​%%--%%lost-found''​ save blobs? Don't think so.
  
 ===== SYNOPSIS ===== ===== SYNOPSIS =====
  
 <​code>​ <​code>​
-git fsck [--tags] [--root] [--unreachable] [--cache] [--no-reflogs] +git fsck 
-         ​[--[no-]full] [--strict] [--verbose] [--lost-found] +  ​[--tags] [--root] [--unreachable] [--cache] [--no-reflogs] 
-         ​[--[no-]dangling] [--[no-]progress] [--connectivity-only] +  [--[no-]full] [--strict] [--verbose] [--lost-found] 
-         ​[--[no-]name-objects] [<​object>​*]+  [--[no-]dangling] [--[no-]progress] [--connectivity-only] 
 +  [--[no-]name-objects] [<​object>​*]
 </​code>​ </​code>​
  
 ===== Dangling versus unreachable ===== ===== Dangling versus unreachable =====
 +
 +A dangling object is an unreachable object which is not reachable even from //other// unreachable objects; a dangling object has no references to it from //any// reference or object in the repository.
  
 <​code>​ <​code>​
-                A<​-----B<​-----C+                A<​-----B<​-----C ​  [no reference to this]
                /                /
               /               /
Line 21: Line 28:
 </​code>​ </​code>​
  
-If nothing points at C, then all of A, B and C are unreachable,​ but only C is dangling.+  * unreachable: ​A, Band C 
 +  * dangling: C only
  
 ===== OPTIONS ===== ===== OPTIONS =====
Line 45: Line 53:
 </​code>​ </​code>​
  
-''​%%--%%unreachable''​ overrides ''​%%--%%no-dangling''​.+Note that ''​%%--%%unreachable''​ overrides ''​%%--%%no-dangling''​.
  
 ===== Examples ===== ===== Examples =====
Line 127: Line 135:
 unreachable commit 69fd5e6a8733ed63293aab658d584150c0af9db2 unreachable commit 69fd5e6a8733ed63293aab658d584150c0af9db2
 $ $
 +</​code>​
 +
 +Consider reflog entries to be unreachable:​
 +
 +<​code>​
 +$ git fsck --unreachable
 +Checking object directories:​ 100% (256/256), done.
 +Checking objects: 100% (11352/​11352),​ done.
 +$
 +</​code>​
 +
 +<​code>​
 +$ git fsck --no-reflogs
 +Checking object directories:​ 100% (256/256), done.
 +Checking objects: 100% (11352/​11352),​ done.
 +dangling commit 3305054f1c03c3a6d25091fc31bba6cbe8cc1c7b
 +dangling commit a20ef4592ca3a29e29420a21d84956d418b8b564
 +dangling commit 858f9d07335434e7e3148116c4b89d78338a3911
 +dangling commit 5f1992a4245c301ed5e556f4ef47153981a67820
 +dangling commit a9211435ad4b79393a9a845b45b6b117a89e77f7
 +dangling commit 67a23d481d11fcab4ff7fb1bb69d829e5b7f3d01
 +dangling commit 51a49991d6ca4e2262c9ca5cc6f414ab49ba635d
 +dangling commit 48c2a6a80a221a3c1328ea5c163ad805320a8287
 +dangling commit 234c0a04dbd517e4debc14fa8fac70793c967901
 +dangling commit a7561cb3f333a7e9fb93cf233fb79c9e1d19847e
 +dangling commit 2be2782c3b03aea7af2622a26e1c673d10d35eb0
 +dangling commit 65633ac0f606e70db50460502989a7a74dca8e20
 +dangling commit 066b84e3461b5e2f231159175e6641e360bb2477
 +dangling commit bb78a0fd0cefa2f6cfb9ecdbd877ce9045e09780
 +dangling commit 99fd08769f3e7c134c4fc97c76edd5e9b4c9e562
 +$
 +</​code>​
 +
 +===== Config options =====
 +
 +<​code>​
 +fsck.skipList
 +    The path to a list of object names (i.e. one unabbreviated
 +    SHA-1 per line) that are known to be broken in a non-fatal
 +    way and should be ignored. On versions of Git 2.20 and
 +    later comments (#), empty lines, and any leading and
 +    trailing whitespace is ignored. Everything but a SHA-1 per
 +    line will error out on older versions.
 </​code>​ </​code>​
git_fsck.1551513553.txt.gz · Last modified: 2019/03/02 07:59 by rpjday