8000 Update patches page by Burgov · Pull Request #916 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Update patches page #916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 16, 2011
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added information on squashing commits
  • Loading branch information
Burgov committed Dec 15, 2011
commit 30e58693f9b593b3c68e64e88d730f79e197b111
23 changes: 23 additions & 0 deletions contributing/code/patches.rst
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,29 @@ with master, don't merge; and force the push to the origin:
$ git rebase -f upstream/master
$ git push -f origin BRANCH_NAME

Often, moderators will ask you to "squash" your commits. This means you will
convert many commits to one commit. To do this, use the rebase command:

.. code-block:: bash

$ git rebase -i head~3
$ git push -f origin BRANCH_NAME
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should add a note about the force push saying that you should always specify the branch name explicitly when doing so to avoid messing other branches in the repo (--force tells git that you really want to mess things so do it carefully)


The number 3 here must equal the amount of commits in your branch. After you
type this command, an editor will popup showing a list of commits:

.. code-block:: text

pick 1a31be6 first commit
pick 7fc64b4 second commit
pick 7d33018 third commit

To squash all commits into the first one, remove the word "pick" before the
second and the last commits, and replace it by the word "squash" or just "s".
When you save, git will start rebasing, and if succesful, will ask you to edit
the commit message, which by default is a listing of the commit messages of all
the commits. When you finish, execute the push command.

.. note::

All patches you are going to submit must be released under the MIT
Expand Down
0