I have a repository on git, which I am cloning from into a server that compiles and runs it.
Since that server is local on my network, I can further clone the project that is accessible via samba or even open it on my preferable editor and work on it from there, doing the changes I need or anything else.
Here is where things get complicated, I would like to be able to keep the clone I have on my server, synchronized(up to date) with the git repository(which I can't push things to), while retaining the changes I do locally to my server repository.
What is the most common practice if there is one for this specific case or what should be the advised route to follow for this?
If I had to describe the current process I do, it would look something like this:
- git reset --hard origin/master
- git fetch origin
- redo all changes
- repeat when new stuff on the origin...
I assume, I would in either case need steps 1 and 2 because if I commit git would complain about changed files not allowing to simple git pull
it.
An alternative to the above, I think would be something like:
- generate patches
- git reset --hard origin/master
- git fetch origin
- apply patches (could fail here depending on how the files changes, so manually would be easier to identify...)
- repeat when new stuff on the origin...
So repeating my question again:
- What is the most common practice, if there is one, for this specific case or what should be the advised route to follow for this scenario?
I am not an expert in git, I do know how to use part of it, but the above scenario is something new for me.