Creating a Pull-Request complying with the contribution guidelines

I’m in the process to getting my first binding into the main repo. The things that puzzle me are the following bits in the guidelines:

  • Pull requests must not contain commits from other users or branches.
  • Before the pull request is merged, make sure that you squash your commits into logical units of work using git rebase -i and git push -f. After every commit the test suite should be passing. Include documentation changes in the same commit so that a revert would remove all traces of the feature or fix.

However, I under in the assumption that I need to sync with the main repo before I can create a PR. How do I do that and still comply with the guidelines? I tried squashing my commits, but from the git documentation I understand that it is not possible. I also don’t know how to remove commits from other people without losing the actual info in there.

How do you guys do it? Is there some workflow that lets me make merges and small commits and still enables me to do the above?

Thanks!

This is for integrity. Since you will be the one signing-off the PR, it has to be you only. Create a new fork and integrate changes if necessary.

You do not necessarily have to be in complete sync with main repo. As long as your changes have no conflict, you should be able to do a P.R. The ‘sync’ part is to allow anyone to just fork your PR repo and test using that repo without having to pull from main (that’s what rebase does, basically)

You gotta love the open source community spirit. Ask a question and sooner or later you WILL get an answer :smile:

4 Likes