[{"data":1,"prerenderedAt":79},["ShallowReactive",2],{"post:stash-specific-files-and-filenames":3},{"id":4,"title":5,"body":6,"date":66,"description":67,"draft":68,"extension":69,"meta":70,"navigation":71,"path":72,"seo":73,"stem":74,"tags":75,"__hash__":78},"posts\u002Fposts\u002Fstash-specific-files-and-filenames.md","TIL: Stash Specific Files and Filenames",{"type":7,"value":8,"toc":63},"minimark",[9,23,40,50,53],[10,11,12,13,17,18,22],"p",{},"Why would you ever want to stash a specific file, as opposed to any and all altered files, you ask? In an ideal world, you probably wouldn't need to. In this specific case, I was attempting to stash files I had modified without stashing other files which had been bulk-edited by a script. In other words, I wished to throw away ",[14,15,16],"em",{},"most"," of my changes and keep one or two specific changes after a ",[19,20,21],"code",{},"git merge",".",[10,24,25,26,33,34,39],{},"See ",[27,28,32],"a",{"href":29,"rel":30},"https:\u002F\u002Fstackoverflow.com\u002Fquestions\u002F5506339\u002Fhow-can-i-git-stash-a-specific-file\u002F5506483#5506483",[31],"nofollow","this question",", of which the ",[27,35,38],{"href":36,"rel":37},"https:\u002F\u002Fstackoverflow.com\u002Fa\u002F5506483\u002F1525594",[31],"accepted answer"," is pretty darn useful:",[41,42,43],"blockquote",{},[10,44,45,46],{},"Since git 2.13, there is a command to save a specific path to the stash: git stash push ",[47,48,49],"path",{},". For example: git stash push -m welcome_cart app\u002Fviews\u002Fcart\u002Fwelcome.thtml.",[10,51,52],{},"Boom:",[54,55,60],"pre",{"className":56,"code":58,"language":59},[57],"language-text","git stash push \u003Cpath>\n","text",[19,61,58],{"__ignoreMap":62},"",{"title":62,"searchDepth":64,"depth":64,"links":65},2,[],"2019-02-20T08:53:12-05:00","Why would you ever want to stash a specific file, as opposed to any and all altered files, you ask? In an ideal world, you probably wouldn't need to. In this specific case, I was attempting to stash files I had modified without stashing other files which had been bulk-edited by a script. In other words, I wished to throw away most of my changes and keep one or two specific changes after a git merge.",false,"md",{},true,"\u002Fposts\u002Fstash-specific-files-and-filenames",{"title":5,"description":67},"posts\u002Fstash-specific-files-and-filenames",[76,77],"git","til","5XwBo14j3EXmsukPWKlZg_kvZNcn-C4_1nbAtyPL-RM",1790471527971]