![]() Don't worry, you can run git stash multiple times and it will save the current changes in the stash in separate entries. While you are fixing the typo you might notice another issue which is even more urgent than fixing the typo. No changes added to commit (use "git add" and/or "git commit -a")ĭropped (7f14ba3a7afa71a7b61df8afdd059542b4761c76) ![]() ![]() " to discard changes in working directory) Naturally, if there are change on the very same line both in the stashed change and in the change you made and committed (the typo), then this command will report a conflict and you'll have to manually resolve it. The changes saved in the stash will be merged back with changes made since you stashed them away. This will bring back the changes that were stashed away by the most recent git stash. With the appropriate SHA1 and the message of the most recent commit at the end of response. Saved working directory and index state WIP on master: 271c4b5 MESSAGE OF THE MOST RECENT COMMIT The response of git stash looks like this: Will save all the changes in all the tracked file in a temporary commit in your local git repository and restore the files to the state they were in after the most recent real commit. You could also use git stash to push aside all the changes you made so far, make the typo fix in a clean workspace, then bring back the changes from the stash and keep working on the bug. You could keep working on the bug creating a mental note that you'll have to fix the typo later on, but mental notes tend to disappear with time. ![]() Was that typo fix really part of the bug fix? A better approach would be to separate the two fixes. Later, when someone reads the change and wants to understand it, this mix will be confusing. You could quickly change the typo as well and later commit it together with the bug-fix, but then you are mixing two unrelated changes. For example, you are in the middle of fixing a bug when you notice a typo in the very same spot where you are making the changes. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |