10pearls / style-guides

Community driven style guides for various programming platforms
10 stars 17 forks source link

Git styles #1

Closed mohuk closed 8 years ago

mohuk commented 8 years ago
safdar-tp commented 8 years ago

Please add this note:

  1. Please set the develop branch as the default.
  2. Restrict Master branch. Only Sr. Dev/TLs can merge/push.
mohuk commented 8 years ago

@safdar-tp will add note about default branch. Github or Git does not allow restrictions on branches but a general understanding within a team can be developed about the Senior folks being owners of staging or master.

umayr commented 8 years ago

You should also add How to structure a commit message in the git style. Commit messages are really important in order to create a useful revision history, teams should first agree on a commit message convention that defines at least the following three things:

I'd suggest imperative commit messages which has been a thing since the beginning of the git. (Relevant: Link, Link, Link, Link, Link, Link)

To summarize, there are seven rules to draft a sensible commit message:

An example commit message taken from here:

Summarize changes in around 50 characters or less

More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of the commit and the rest of the text as the body. The
blank line separating the summary from the body is critical (unless
you omit the body entirely); various tools like `log`, `shortlog`
and `rebase` can get confused if you run the two together.

Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how (the code explains that).
Are there side effects or other unintuitive consequenses of this
change? Here's the place to explain them.

Further paragraphs come after blank lines.

 - Bullet points are okay, too

 - Typically a hyphen or asterisk is used for the bullet, preceded
   by a single space, with blank lines in between, but conventions
   vary here

If you use an issue tracker, put references to them at the bottom,
like this:

Resolves: #123
See also: #456, #789
umayr commented 8 years ago

Github or Git does not allow restrictions on branches but a general understanding within a team can be developed about the Senior folks being owners of staging or master.

@mohuk, you're correct but one can restrict master and staging from force pushes.

mohuk commented 8 years ago

@umayr @safdar-tp I think I found some help on Github docs and Stackoverflow.

:+1: