Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There's nothing for pushing (or pulling) reflogs, but it would be easy to "fake it" by using the hierarchical nature of the <code>refs/</code> space to make up temporary (or maybe even not that temporary) refs and pushing those. You could then run a post-push script—perhaps even do this directly from post-receive—to build the desired reflogs on the other end, using <code>git update-ref</code>.</p> <p>Let's say (for design sketch purposes) you choose <code>refs/sync/</code> as the top level of your new name-space. Then:</p> <pre><code># find reflogs - change this to use the ones you care about unfiltered=$( for refname in $(cd $(git rev-parse --git-dir)/logs &amp;&amp; find * -type f -print); do echo $refname done ) filtered=... # something ... filtered="HEAD refs/heads/master" # for now for reflog in $filtered; do # change name from (.*)@{([0-9]+)} to \1/\2 # (keep commit ID at left) git reflog --no-abbrev $reflog | sed -n 's,\([^ ]*\) \(.*\)@{\([0-9][0-9]*\)}:.*,\1 \2/\3,p' done </code></pre> <p>The output from this (so far) is a sequence of hash values and names, so it can then be piped to:</p> <pre><code>while read hash name; do git update-ref -m 'create for transport' refs/sync/$name $hash done </code></pre> <p>Now you can <code>git push</code> the <code>refs/sync/</code> namespace to the remote, then delete all the <code>refs/sync/</code> names (either delete the ones created here, or just delete all <code>refs/sync/</code> names up front—you might want to do that anyway in case one of these update sequences is interrupted):</p> <pre><code>git for-each-ref --format 'git update-ref -d %(refname)' refs/sync/ | sh </code></pre> <p>On the remote, having received <code>refs/sync/*</code> refs, you can then turn them back into reflog entries by reversing the above process (it's even a bit easier, you just want to reverse-sort numerically by final component so that the oldest log entries are update-ref'ed first).</p> <p>As the other answer says, depending this heavily on reflogs might not be all that wise. You could use the above techniques to turn existing reflog entries into something more permanent (like tags, which already live in <code>refs/tags/</code>; you could perhaps use a subset name-space, <code>refs/tags/autotag/NNN</code> for instance).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload