I've been working on a project for the past couple of hours and when you're using the trial and error strategy you most likely forget the commit changes that should be in separate commits to keep a clean history.
At least, that was what happened to me and now I'm trying to solve my mistake.
I know about git add -p
to only stage the changes I want to stage instead of a whole file when I want to stage a single line of code.
Obviously you don't want to commit something broken so I wanted to test whether I could still compile the project when I stashed all the unstaged changes using git stash push -k -u
and I saw that I forgot to stage a change. I did git stash pop
but that's when the problem came walking through the door and smashed me in the face, there were merge conflicts in every single file that I had partially staged using git add -p
.
I used the following documentation from Git to get to the point where I am now:
https://git-scm.com/docs/git-stash#git-stash-Testingpartialcommits