I am using GIT
and I am working on 2 tasks at the same time. Task 1 and Task2. Now I want to push to the server Task1. So I commit all related files of Task 1 (T1) to the staging area.
My Staging area its ready to be pushed to the server, but before doing this, I consider it would be safe to check if my staging area its compiling and passing the tests.
How can I get a working dir with the staging area only changes in order to compile it
and run the automated tests?
Note I dont want to run tests of the working directory, only of the staging area...Because working dir has changes related from T1 and T2.
You could git stash save
to save all of your non-related changes into a stash, run your tests, then restore the non-related changes with git stash pop
. (If it were me, I would first read man git-stash to ensure I got all of the steps in the right order.)
This sounds to me like you should be using git branches. Each of your tasks would be developed on a separate branch and you can push one before the other, and merge up from the first completed branch (task) to the second.
See here for more details.
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