3 回答

TA貢獻1810條經驗 獲得超4個贊
無法通過fetch或類似方式獲取它,鏡像refspec是fetch = +refs/*:refs/*
,即使隱藏,refs/stash
它也不會發送。顯式refs/stash:refs/stash
也不起作用!
無論如何,這只會令人困惑,因為那不會獲取所有存儲,只有最新存儲。存放清單是ref 的reflogrefs/stashes
。

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
- 3 回答
- 0 關注
- 1259 瀏覽
添加回答
舉報