3 回答

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊
無(wú)法通過(guò)fetch或類似方式獲取它,鏡像refspec是fetch = +refs/*:refs/*
,即使隱藏,refs/stash
它也不會(huì)發(fā)送。顯式refs/stash:refs/stash
也不起作用!
無(wú)論如何,這只會(huì)令人困惑,因?yàn)槟遣粫?huì)獲取所有存儲(chǔ),只有最新存儲(chǔ)。存放清單是ref 的reflogrefs/stashes
。

TA貢獻(xiàn)2037條經(jīng)驗(yàn) 獲得超6個(gè)贊
注意:我剛剛用24小時(shí)的git-fu重寫了這個(gè)答案:)在我的shell歷史中,整個(gè)shebang現(xiàn)在是三個(gè)單線。但是,為方便起見,我將它們簡(jiǎn)化了。
這樣,我希望您能夠看到我的工作方式,而不必盲目地復(fù)制/粘貼內(nèi)容。
這是逐步的。
假定?/ OLDREPO中包含隱藏項(xiàng)的源。創(chuàng)建一個(gè)不包含存儲(chǔ)的TEST克?。?/p>
cd ~/OLDREPO
git clone . /tmp/TEST
將所有存儲(chǔ)卡推送為臨時(shí)分支:
git send-pack /tmp/TEST $(for sha in $(git rev-list -g stash); \
do echo $sha:refs/heads/stash_$sha; done)
在接收端循環(huán),以變回隱藏處:
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
清理臨時(shí)分支機(jī)構(gòu)
git branch -D $(git branch|cut -c3-|grep ^stash_)
做一個(gè)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
在原始存儲(chǔ)庫(kù)上,看起來(lái)像
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
- 3 回答
- 0 關(guān)注
- 1271 瀏覽
添加回答
舉報(bào)