I have a question which I thought here is the best place to ask.
I deal with Raspberry Linux source to compile the Kernel with my own changes.
As a clean install, I normally clone the main repository as per documentation:
Code: Select all
git clone --depth=1 https://github.com/raspberrypi/linuxIf I want to do the compile , for instance a month later, I need to get the latest kernel source but keep my changes.
What is the best way to update my local GIT source with changes on remote and then apply my changes?
I generally do this :
git fetch origin
git reset --hard origin/master <or branch>
git clean -f -d
but this normally does not work and I loose my changes and have to apply them again!
can you please advise what I have to do to get my local GIT get update from latest changes on remote and then I can apply my changes back to updated one?
------------------
Update:
I have done this and I think is ok. Can you please someone with more experience confirm if this is the best approach?!
Thanks
git add <my files>
git commit -m "My changes..."
git fetch origin
git reset --hard origin/master <or branch for example I did : origin/rpi-4.4.y>
git merge
git checkout <my commit ID> <path to my file>
