git show shows information about that particular commit. $ git fsck 2> /dev/null | awk '/commit/’ to obtain the third part of each line.ĥ. I always include the bug reference number in stash descriptions, so I was ready to retrieve the stash from the command line: We have a nice release log, so I easily found the bug reference number which the lost code fixed. If you can remember the description assigned to your stash, you’re more or less fine. Reading through the answers, I discovered that a stash is just another commit in your repo and that deleted ones are orphaned. StackOverflow where I discovered this question Retrieve deleted stash in Git using SourceTree an exact depiction of my problem. I started off my research at the source of all developer knowledge A.K.A. I didn’t panic, as I could have re-written the fix, but as a developer, I prefer to learn how to reverse the deletion, even if it took 10 hours of trial-and-error instead of a 10-minute rewrite. I realized at this point I had placed the fixes I needed in a stash, which I had later deleted. If you’re in the middle of working on something and need to test your code as it was before you started, you can place your changes in a stash, return to a stable starting point to test and when you’re ready, re-apply the stash and resume working. Then suddenly you recall deleting an unimportant git stash this morning because everything has been deployed already.įor those who are not git-savvy, git is a controlled version system and a stash, is a temporary shelf to place your unfinished drafts. Was it a merge conflict or uncommitted? Could it have been the Matrix conspiring against you or even gremlins? You compare it against other versions and can’t find a git change associated with your name. You fixed it one day ago so the bug can’t be there, the customer must be wrong?!Īfter running the application, waiting to not see the bug, it’s there again! You quickly head to your source code and… yikes, your old code is there, with no traces of your fixes. The story goes a little something like this…Ī customer directs your attention to a bug you know you’ve solved, tested and shipped. This is a scary story, not like a horror movie, but frightening enough to give any developer the shivers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |