0

I am fairly new to git and have read several similar threads on stackoverflow but please let me know if I missed one.

My scenario is pretty simple:

  1. I start working on a POC with lots of code changes, using git as my version control system
  2. Someone comes along with a hotfix that I need to do

From here I would like to save my POC somehow so that I can return to it after I have fixed, committed and pushed the hotfix to the remote repository.

I think it might involve the "stage" concept in git but I can't see how I can commit and push only the hotfix changes and not the staged ones, unless I start changing the order of commits around which I would like to avoid if possible. Does anyone have a simple overview (a list of git commands would do) that I can dig into?

Stig Perez
  • 3,595
  • 4
  • 23
  • 36

1 Answers1

1

I would say this really depends on how long you plan on working on the other task. If it is going to be an matter of minutes or perhaps hours then perhaps just stash the changes.

# To Stash 
git stash

# To List
git stash list

# To Apply
git stash apply

But for confidence that you will not loose this work then creating a branch and pushing it to the remote is a lot better an idea.

Purple Hexagon
  • 3,538
  • 2
  • 24
  • 45