• limer@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    6 hours ago

    This is good:

    As a consequence of that, you can now export your stashes to a single reference, and then push or pull it like you would a normal branch or tag. Git 2.51 makes this easy by introducing two new sub-commands to git stash to import and export, respectively. You can now do something like:

    $ git stash export --to-ref refs/stashes/my-stash
    $ git push origin refs/stashes/my-stash
    

    on one machine to push the contents of your stash to origin, and then:

    $ git fetch origin '+refs/stashes/*:refs/stashes/*'
    $ git stash import refs/stashes/my-stash
    

    on another, preserving the contents of your stash between the two.