Git: Difference between revisions

632 bytes added ,  6 July 2016
→‎Commands: add git maint commands
→‎Useful git aliases: update aliases
→‎Commands: add git maint commands
Line 103: Line 103:
$ git config core.filemode false
$ git config core.filemode false
</source>
</source>
== Maintenance command ==
Verify the connectivity and validity of the objects
<syntaxhighlight lang="bash">
$ git fsck --unreachable
</syntaxhighlight>
Manage reflog information
<syntaxhighlight lang="bash">
$ git reflog expire --expire=0 --all
</syntaxhighlight>
Pack unpacked objects in a repository
<syntaxhighlight lang="bash">
$ git repack -a -d -l
</syntaxhighlight>
Prune all unreachable objects from the object database
<syntaxhighlight lang="bash">
$ git prune
</syntaxhighlight>
Clean up unnecessary files and optimize the local repository
<syntaxhighlight lang="bash">
$ git gc --aggressive
</syntaxhighlight>


= Useful git aliases =
= Useful git aliases =