From 5c783bc23403a0127cbc8435866eef78121d74a0 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Fri, 7 Jul 2017 16:32:59 +0100 Subject: [PATCH] Add best practice about not using "git commit -a" --- common-flow.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/common-flow.md b/common-flow.md index 2314dbd..40d3b6f 100644 --- a/common-flow.md +++ b/common-flow.md @@ -168,16 +168,19 @@ interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119). the official git documentation: - 2. You SHOULD always use "--force-with-lease" when doing a force push. The + 2. You SHOULD never blindly commit all changes with "git commit -a". Use + "git add" to add individual changes to the staging area so you are fully + aware of what you are committing. + 3. You SHOULD always use "--force-with-lease" when doing a force push. The plain "--force" option is dangerous and destructive. More information: - 3. You SHOULD understand and be comfortable with + 4. You SHOULD understand and be comfortable with rebasing: - 4. It is RECOMMENDED that you always do "git pull --rebase" instead of "git + 5. It is RECOMMENDED that you always do "git pull --rebase" instead of "git pull" to avoid unnecessary merge commits. You can make this the default behavior of "git pull" with "git config --global pull.rebase true". - 5. It is RECOMMENDED that all branches be merged using "git merge --no-ff". + 6. It is RECOMMENDED that all branches be merged using "git merge --no-ff". This makes sure the reference to the original branch is kept in the commits, allows one to revert a merge by reverting a single merge commit, and creates a merge commit to mark the integration of the branch with