0

I am making changes on a branch that aren't ready to commit yet. I need to work on something else for a while, so I've stashed them.

Question: I want to back up my stash changes in case my machine dies. What's the least painful way to do this? I found the second answer to this question, but it looks a bit frightening.

Right now I'm thinking of adding a temporary commit called 'work in progress' to the branch and pushing it. Then after finishing the work, I'll roll back the temporary commits, erase history, and do proper atomic tested commits. That keeps everything safe. But, it's also horrible.

Is there a simple, intuitive, safe Git way to solve this problem?

Community
  • 1
  • 1
Richard
  • 62,943
  • 126
  • 334
  • 542
  • Possibly this answer is the least stressful, and I just shouldn't worry about erasing history: http://stackoverflow.com/a/18477881/194000 – Richard Jan 27 '16 at 11:54
  • 1
    Why not just create your own local branch and commit as much as you like in it? If you want to back *it* up you could push it to some other remote somewhere. – Biffen Jan 27 '16 at 11:55
  • *you could push it to some other remote somewhere* that is not always allowed. Company policy etc. – Tim Jan 27 '16 at 11:56
  • @Biffen yes, I think that is the best answer for me. Thanks! – Richard Jan 27 '16 at 11:56
  • 1
    @TimCastelijns Set up your own remote on your own machine, an external drive, etc. and it could very well be within policy. – Biffen Jan 27 '16 at 11:56

0 Answers0