I’d like to be able to stash just the changes from a single file:
git stash save -- just_my_file.txt
The above doesn’t work though. Any alternatives?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think
stash -pis probably the choice you want, but just in case you run into other even more tricky things in the future, remember that:Stashis really just a very simple alternative to the only slightly more complexbranchsets. Stash is very useful for moving things around quickly, but you can accomplish more complex things with branches without that much more headache and work.go about and do what you want, and then later simply
rebaseand/ormergethe tmpbranch. It really isn’t that much extra work when you need to do more careful tracking than stash will allow.