[fpc-devel] Submitting patches using git
Jonas Maebe
jonas at freepascal.org
Sat Jul 20 19:04:14 CEST 2019
On 20/07/2019 18:58, Ryan Joseph wrote:
> I’m getting better with git but I’m still having problems with basic workflows. My newest dilemma is trying to submit a patch which is actually up to date with the current master branch (https://bugs.freepascal.org/view.php?id=35140). Here’s what I do:
>
> 1) pull changes from the master remote upstream into my master branch (this is: https://github.com/graemeg/freepascal).
> 2) merge the updated local master branch into the feature branch and resolve any conflicts if need be.
> 3) remove .gitignore (which now includes thousands of .o/.ppu files which need to be deleted) and any other unrelated personal files.
> 4) squash all commits into a single so the patch doesn’t include the entire commit history.
> 5) finally make a nice clean patch using: git format-patch master --stdout > patch.diff
>
> The problem is that since I merged the updated master branch I can’t squash commits because git complains "only commits reachable from HEAD can be modified”. Is this not how I’m supposed to keep my local feature branch up-to-date with the server? Any advice would be great.
You can rebase your feature branch on latest trunk/master instead of
merging. I think that may even work after you have previously merged it
(and it should get rid of all merge commits).
Jonas
More information about the fpc-devel
mailing list