Save git

Like me

Save a git stash and save its long terms so that I can access it in the future (maybe save it in some kind of patch file) even after the stash itself is cleared. IE how to save a specific file to a file so that I can clear the current stashes and that nothing will be displayed if I make a git stash list, and still I will still have access to the saved stash revision in the future if I want

+4
source share
1 answer

You asked for a file, but I would use git to save a set of changes - it's much easier to track than a file.

Create a new branch

git checkout -b saved_stash 

the prefix pops up, adds and fixes

 git stash pop git add . git commit -m 'save stash for later' 

If you want to use it again, check the branch, reset commit and add to it again

 git checkout saved_stash git reset --soft HEAD~1 git stash 

At this point, you should have the same state that you saved.

(typed in a team, teams can be slightly disabled - I hope only a little)

+3
source

All Articles