For my project I keep an online repository on github and local repositories on two computers (say A, B) where I write code and run tests and also on three other machines (say, C, D, E) where I just run tests.
Now, it happened a few times that there are conflicts whenever I want to just download updated code on C, D, E and doing just git pull origin $someBranch won’t work, probably due to some small modifications that I did on the local source code just for testing purposes and which I don’t want to keep.
What should I do in this case? Should I always do git clone $URLofMyRepository or are there less aggressive ways?
You can remove the changes to your branch if you do not want to keep them using:
This should remove all unsaved changes to your working directory, allowing you to perform a pull.
If you want to keep the changes in your branch try stashing them, then running the pull command.
Assuming no other stashes have occurred these changes can be applied at a later time by performing: