Skip to content

How to make a nice commits #3

@ZitaNemeckova

Description

@ZitaNemeckova

Commit messages

  • Squash commits if they do the same thing like below

screen shot 2018-04-09 at 6 55 00 pm

  • Don't mention RepositoryForm. It was an example...

screen shot 2018-04-09 at 6 53 26 pm

  • Get rid of commits you don't want. Like that one hacky change we needed to make it work :)

screen shot 2018-04-09 at 6 52 31 pm

screen shot 2018-04-09 at 6 51 17 pm

  • No merge commits! Delete it!

screen shot 2018-04-09 at 6 50 31 pm

  • No wip in commit message. Change it!

screen shot 2018-04-09 at 6 45 13 pm

  • Too much info. No need to write about modified files.

screen shot 2018-04-09 at 6 58 03 pm

  • No Czech. Only English.

  • Don't mention SWI.

  • Having only one commit. Shame on you.

How to fix it

git rebase -i master

  • p, pick = use commit
  • r, reword = use commit, but edit the commit message
  • e, edit = use commit, but stop for amending (you can change changes)
  • s, squash = use commit, but meld into previous commit (you can change commit message)
  • f, fixup = like "squash", but discard this commit's log message (you can't change commit message)
  • x, exec = run command (the rest of the line) using shell (never used and you should't use it either)
  • d, drop = remove commit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions