Junio C Hamano | 7464064 | 2006-12-27 10:59:55 | [diff] [blame] | 1 | git-reflog(1) |
| 2 | ============= |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git-reflog - Manage reflog information |
| 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 11 | 'git reflog' <subcommand> <options> |
Junio C Hamano | 7464064 | 2006-12-27 10:59:55 | [diff] [blame] | 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 15 | The command takes various subcommands, and different options |
| 16 | depending on the subcommand: |
| 17 | |
| 18 | [verse] |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 19 | 'git reflog expire' [--dry-run] [--stale-fix] [--verbose] |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 20 | [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>... |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 21 | 'git reflog delete' ref@\{specifier\}... |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 22 | 'git reflog' ['show'] [log-options] [<ref>] |
Junio C Hamano | 7464064 | 2006-12-27 10:59:55 | [diff] [blame] | 23 | |
| 24 | Reflog is a mechanism to record when the tip of branches are |
| 25 | updated. This command is to manage the information recorded in it. |
| 26 | |
| 27 | The subcommand "expire" is used to prune older reflog entries. |
| 28 | Entries older than `expire` time, or entries older than |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 29 | `expire-unreachable` time and not reachable from the current |
Junio C Hamano | 7464064 | 2006-12-27 10:59:55 | [diff] [blame] | 30 | tip, are removed from the reflog. This is typically not used |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 31 | directly by the end users -- instead, see linkgit:git-gc[1]. |
Junio C Hamano | 7464064 | 2006-12-27 10:59:55 | [diff] [blame] | 32 | |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 33 | The subcommand "show" (which is also the default, in the absence of any |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 34 | subcommands) will take all the normal log options, and show the log of |
Junio C Hamano | 2e72a94 | 2007-11-21 08:54:42 | [diff] [blame] | 35 | the reference provided in the command-line (or `HEAD`, by default). |
| 36 | The reflog will cover all recent actions (HEAD reflog records branch switching |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 37 | as well). It is an alias for `git log -g --abbrev-commit --pretty=oneline`; |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 38 | see linkgit:git-log[1]. |
Junio C Hamano | 2e72a94 | 2007-11-21 08:54:42 | [diff] [blame] | 39 | |
| 40 | The reflog is useful in various git commands, to specify the old value |
| 41 | of a reference. For example, `HEAD@\{2\}` means "where HEAD used to be |
| 42 | two moves ago", `master@\{one.week.ago\}` means "where master used to |
Junio C Hamano | c27b733 | 2010-10-14 04:37:28 | [diff] [blame] | 43 | point to one week ago", and so on. See linkgit:gitrevisions[7] for |
Junio C Hamano | 2e72a94 | 2007-11-21 08:54:42 | [diff] [blame] | 44 | more details. |
Junio C Hamano | 7464064 | 2006-12-27 10:59:55 | [diff] [blame] | 45 | |
Junio C Hamano | 86bcccc | 2008-03-08 09:33:55 | [diff] [blame] | 46 | To delete single entries from the reflog, use the subcommand "delete" |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 47 | and specify the _exact_ entry (e.g. "`git reflog delete master@\{2\}`"). |
Junio C Hamano | 86bcccc | 2008-03-08 09:33:55 | [diff] [blame] | 48 | |
Junio C Hamano | 7464064 | 2006-12-27 10:59:55 | [diff] [blame] | 49 | |
| 50 | OPTIONS |
| 51 | ------- |
| 52 | |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 53 | --stale-fix:: |
| 54 | This revamps the logic -- the definition of "broken commit" |
| 55 | becomes: a commit that is not reachable from any of the refs and |
| 56 | there is a missing object among the commit, tree, or blob |
| 57 | objects reachable from it that is not reachable from any of the |
| 58 | refs. |
| 59 | + |
| 60 | This computation involves traversing all the reachable objects, i.e. it |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 61 | has the same cost as 'git prune'. Fortunately, once this is run, we |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 62 | should not have to ever worry about missing objects, because the current |
| 63 | prune and pack-objects know about reflogs and protect objects referred by |
| 64 | them. |
| 65 | |
Junio C Hamano | 7464064 | 2006-12-27 10:59:55 | [diff] [blame] | 66 | --expire=<time>:: |
| 67 | Entries older than this time are pruned. Without the |
| 68 | option it is taken from configuration `gc.reflogExpire`, |
| 69 | which in turn defaults to 90 days. |
| 70 | |
| 71 | --expire-unreachable=<time>:: |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 72 | Entries older than this time and not reachable from |
Junio C Hamano | 7464064 | 2006-12-27 10:59:55 | [diff] [blame] | 73 | the current tip of the branch are pruned. Without the |
| 74 | option it is taken from configuration |
| 75 | `gc.reflogExpireUnreachable`, which in turn defaults to |
| 76 | 30 days. |
| 77 | |
| 78 | --all:: |
| 79 | Instead of listing <refs> explicitly, prune all refs. |
| 80 | |
Junio C Hamano | 86bcccc | 2008-03-08 09:33:55 | [diff] [blame] | 81 | --updateref:: |
| 82 | Update the ref with the sha1 of the top reflog entry (i.e. |
| 83 | <ref>@\{0\}) after expiring or deleting. |
| 84 | |
| 85 | --rewrite:: |
| 86 | While expiring or deleting, adjust each reflog entry to ensure |
| 87 | that the `old` sha1 field points to the `new` sha1 field of the |
| 88 | previous entry. |
| 89 | |
Junio C Hamano | 764a667 | 2007-10-23 01:23:31 | [diff] [blame] | 90 | --verbose:: |
| 91 | Print extra information on screen. |
| 92 | |
Junio C Hamano | 7464064 | 2006-12-27 10:59:55 | [diff] [blame] | 93 | Author |
| 94 | ------ |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 95 | Written by Junio C Hamano <gitster@pobox.com> |
Junio C Hamano | 7464064 | 2006-12-27 10:59:55 | [diff] [blame] | 96 | |
| 97 | Documentation |
| 98 | -------------- |
| 99 | Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. |
| 100 | |
| 101 | GIT |
| 102 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 103 | Part of the linkgit:git[1] suite |