0

Right now git status returns On branch master. And there are Changes not staged for commit: modified: foo. Suddenly I get a bug report. How do I temporarily quit the main job I'm doing, make the change, put it into production, and then go back to the main job?

I know I should create a new branch. But I'm afraid of doing something wrong and I don't want to create a disaster.

marco987
  • 59
  • 1
  • 9
  • 5
    Please look into using `git stash` or worktree. This question has been asked here before, for certain. – Tim Biegeleisen May 12 '21 at 08:40
  • 1
    Does this answer your question? [Is there any way to save my current change without Commit or Stash in Git?](https://stackoverflow.com/questions/51829099/is-there-any-way-to-save-my-current-change-without-commit-or-stash-in-git) or [this one](https://stackoverflow.com/questions/45352246/how-to-switch-and-save-without-commit-in-git) or [this one](https://stackoverflow.com/questions/41226396/how-do-i-save-work-in-progress-without-using-git-stash). – Joachim Sauer May 12 '21 at 08:42
  • Thanks @Tim Biegeleisen. I'm vaguely familiar with the topic. As I've already explained I'm afraid of doing damage, and I haven't found a step-by-step guide that gives me confidence.... – marco987 May 12 '21 at 08:44
  • 3
    If you are afraid of doing something wrong, the good solution is often to 1. Create a branch 2. Commit. After that you are covered and you will always be able to retrieve your work in progress one way or another. – Philippe May 12 '21 at 08:48

0 Answers0