git stash -> merge stashed change with current changes

后端 未结 8 2278
故里飘歌
故里飘歌 2020-12-12 13:27

I made some changes to my branch and realized I forgot I had stashed some other necessary changes to said branch. What I want is a way to merge my stashed changes with the

8条回答
  •  孤城傲影
    2020-12-12 14:03

    May be, it is not the very worst idea to merge (via difftool) from ... yes ... a branch!

    > current_branch=$(git status | head -n1 | cut -d' ' -f3)
    > stash_branch="$current_branch-stash-$(date +%yy%mm%dd-%Hh%M)"
    > git stash branch $stash_branch
    > git checkout $current_branch
    > git difftool $stash_branch
    

提交回复
热议问题