Tommy Jinks
Tommy Jinks

Reputation: 757

Will stash apply still work after a commit?

If I do git stash to store my changes, make some other changes and commit, am I able to do a git stash apply to merge my previous changes into my latest ones?

I have done a weeks worth of work (still incomplete), but during this time I have been asked to make a small change to another part of the site. I have made this small change, and want to commit it without committing my weeks worth of work. I know I can use git stash to temporarily store this work, but will a commit overwrite the stash?

Upvotes: 1

Views: 74

Answers (1)

Brian Agnew
Brian Agnew

Reputation: 272237

Briefly, yes. git stash will persist changes across commits.

I would, however, prefer to perform the above workflow by creating a development branch for your feature, and switch to/patch your release branch when quick fixes are required.

Upvotes: 3

Related Questions