I think you need a workflow with two branches. The combined local branch (master) and the remote read-only tracking branch (remote).
Using dual remotes on the main branch allows you to continue working and update the remote project. Your local changes and merged remote changes can be transferred to the local git server.
git push localserver master
Source patches can be created and updated in your branches of remote tracking and submitted to the project.
A separate tracking branch for the remote read-only allows you to prepare corrections and commits for the upstream to the remote project.
# Master branch is merge of local changes, and remote changes git checkout master git pull -m origin master
If you want to go back to the patch, then diff from master..remote can be used to determine the fix for your remote read-only branch.
git diff master..remote -- files >patch git checkout remote patch -p1 <patch git commit -m "Your patch" git format-patch -1
Send the formatted patch file to the remote project. If you need to make changes and reinstall the remote project, you can perform this work in your remote tracking branch until it is approved.
(Setting up a dual git console involves editing .git / config and is explained elsewhere)
source share