是否可以将 git stash 推送到远程存储库? [英] Is it possible to push a git stash to a remote repository?
问题描述
在 git 中,是否可以创建存储、将存储推送到远程存储库、在另一台计算机上检索存储并应用存储?
In git, is it possible to create a stash, push the stash to a remote repository, retrieve the stash on another computer, and apply the stash?
或者是我的选择:
- 创建补丁并将补丁复制到另一台计算机,或
- 创建一个小分支并将未完成的工作提交到该分支?
推荐答案
无法通过 fetch 左右获取,镜像 refspec 为 fetch = +refs/*:refs/*
,即使 stash 是 refs/stash
它也不会被发送.显式的 refs/stash:refs/stash
也无效!
It's not possible to get it via fetch or so, the mirror refspec is fetch = +refs/*:refs/*
, and even though stash is refs/stash
it doesn't get sent. An explicit refs/stash:refs/stash
has no effect either!
无论如何这只会令人困惑,因为这不会获取所有隐藏内容,只会获取最新的内容;stash 列表是 ref refs/stashes
的 reflog.
It would only be confusing anyway since that wouldn't fetch all stashes, only the latest one; the list of stashes is the reflog of the ref refs/stashes
.
这篇关于是否可以将 git stash 推送到远程存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!