亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

是否可以將git stash推送到遠程存儲庫?

是否可以將git stash推送到遠程存儲庫?

Git
呼喚遠方 2019-10-05 15:15:35
在git中,是否可以創建存儲,將存儲推到遠程存儲庫,在另一臺計算機上檢索存儲,然后應用存儲?還是我的選擇:創建補丁并將補丁復制到另一臺計算機,或者創建一個次要分支并將未完成的工作提交給該分支?
查看完整描述

3 回答

?
蝴蝶不菲

TA貢獻1810條經驗 獲得超4個贊

無法通過fetch或類似方式獲取它,鏡像refspec是fetch = +refs/*:refs/*,即使隱藏,refs/stash它也不會發送。顯式refs/stash:refs/stash也不起作用!

無論如何,這只會令人困惑,因為那不會獲取所有存儲,只有最新存儲。存放清單是ref 的reflogrefs/stashes。


查看完整回答
反對 回復 2019-10-05
?
阿晨1998

TA貢獻2037條經驗 獲得超6個贊

注意:我剛剛用24小時的git-fu重寫了這個答案:)在我的shell歷史中,整個shebang現在是三個單線。但是,為方便起見,我將它們簡化了。


這樣,我希望您能夠看到我的工作方式,而不必盲目地復制/粘貼內容。


這是逐步的。


假定?/ OLDREPO中包含隱藏項的源。創建一個不包含存儲的TEST克?。?/p>


cd ~/OLDREPO

git clone . /tmp/TEST

將所有存儲卡推送為臨時分支:


git send-pack /tmp/TEST $(for sha in $(git rev-list -g stash); \

    do echo $sha:refs/heads/stash_$sha; done)

在接收端循環,以變回隱藏處:


cd /tmp/TEST/

for a in $(git rev-list --no-walk --glob='refs/heads/stash_*'); 

do 

    git checkout $a && 

    git reset HEAD^ && 

    git stash save "$(git log --format='%s' -1 HEAD@{1})"

done

清理臨時分支機構


git branch -D $(git branch|cut -c3-|grep ^stash_)

做一個git stash列表,您將像這樣:


stash@{0}: On (no branch): On testing: openmp import

stash@{1}: On (no branch): On testing: zfsrc

stash@{2}: On (no branch): WIP on sehe: 7006283 fixed wrong path to binary in debianized init script (reported as part of issue

stash@{3}: On (no branch): WIP on debian-collab: c5c8037 zfs_pool_alert should be installed by default

stash@{4}: On (no branch): WIP on xattrs: 3972694 removed braindead leftover -O0 flag

stash@{5}: On (no branch): WIP on testing: 3972694 removed braindead leftover -O0 flag

stash@{6}: On (no branch): WIP on testing: db9f77e fuse_unmount_all could be starved for the mtx lock

stash@{7}: On (no branch): WIP on xattrs: db9f77e fuse_unmount_all could be starved for the mtx lock

stash@{8}: On (no branch): WIP on testing: 28716d4 fixed implicit declaration of stat64

stash@{9}: On (no branch): WIP on emmanuel: bee6660 avoid unrelated changes

在原始存儲庫上,看起來像


stash@{0}: WIP on emmanuel: bee6660 avoid unrelated changes

stash@{1}: WIP on testing: 28716d4 fixed implicit declaration of stat64

stash@{2}: WIP on xattrs: db9f77e fuse_unmount_all could be starved for the mtx lock

stash@{3}: WIP on testing: db9f77e fuse_unmount_all could be starved for the mtx lock

stash@{4}: WIP on testing: 3972694 removed braindead leftover -O0 flag

stash@{5}: WIP on xattrs: 3972694 removed braindead leftover -O0 flag

stash@{6}: WIP on debian-collab: c5c8037 zfs_pool_alert should be installed by default

stash@{7}: WIP on sehe: 7006283 fixed wrong path to binary in debianized init script (reported as part of issue #57)

stash@{8}: On testing: zfsrc

stash@{9}: On testing: openmp import


查看完整回答
反對 回復 2019-10-05
  • 3 回答
  • 0 關注
  • 1259 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號