I have two different branches of the same software that I work on every day. However, every time I checkout the other branch, my build process can take up to an hour. To solve this, I have just checked out the project once for each branch in two separate folders.
I did some work in one branch, and realized before committing it that I was in the wrong folder, and thus the wrong branch. How can I move the work I did on this branch, to the other branch, preferably without creating a commit (if that is even possible)?
In the directory with the changes, do:
$ git diff > patch
cd to the other directory, and do:
git apply /path/to/patch
Well, you can also not build the other branch..
Naturally, this only works if you can allow yourself to commit without building (reasonable in some scenarios).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With