• Stars
    star
    611
  • Rank 73,401 (Top 2 %)
  • Language
    Shell
  • Created over 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tiny semantic commit messages for Git.

Semantic Git commit messages

Inspired by Sparkbox's awesome article on semantic commit messages.

What is this?

These are very simple custom git commands that enforce the git user to write better git commit messages. If still confused, read the article above.

Installation:

  1. Clone this repo, preferably in your $HOME directory.
git clone https://github.com/fteem/git-semantic-commits ~/.git-semantic-commits

Tip: If you're using Cygwin, open it and type echo $USERPROFILE. This will show you the location of the $HOME directory.

  1. Install it as a set of bash scripts or git aliases:
  • bash scripts
cd ~/.git-semantic-commits && ./install.sh --scripts
  • git aliases
cd ~/.git-semantic-commits && ./install.sh

Tip: Installation script is idempotent and could be harmlessly executed multiple times. It adds bash scripts to the PATH in your ~/.bashrc or ~/.zshrc files or adds git aliases to the ~/.gitconfig file respectively (without any duplication).

  1. Commit away!

Usage

There are 8 new Git commands now.

New command -> what it does:

  • git feat "commit message here" -> git commit -m 'feat: commit message here'
  • git docs "commit message here" -> git commit -m 'docs: commit message here'
  • git chore "commit message here" -> git commit -m 'chore: commit message here'
  • git fix "commit message here" -> git commit -m 'fix: commit message here'
  • git refactor "commit message here" -> git commit -m 'refactor: commit message here'
  • git style "commit message here" -> git commit -m 'style: commit message here'
  • git test "commit message here" -> git commit -m 'test: commit message here'
  • git localize "commit message here" -> git commit -m 'localize: commit message here'

If you would like to add an optional scope, as described here, use the '-s' flag and quote the scope message:

  • git docs -s "scope here" "commit message here" -> git commit -m 'docs(scope here): commit message here'

If you would still like to use your text editor for your commit messages you can omit the message, and do your commit message in your editor.

  • git feat -> git commit -m 'feat: ' -e

Aliases for those who use git-extras (will be installed only if you have git-extras):

  • git rf "commit message here" -> git commit -m 'refactor: commit message here'
  • git ch "commit message here" -> git commit -m 'chore: commit message here'

Uninstallation

You can manually uninstall git-semantic-commits by:

  • Removing the added aliases from ~/.gitconfig.
  • Removing the line added to the $PATH variable from ~/.bashrc.

How to contribute

Open a pull request/issue or fork this repo and submit your changes via a pull request.

More Repositories

1

go-playground

My Go playground.
Go
59
star
2

RxRubyKoans

RxRuby Koans
Ruby
16
star
3

excountries

πŸ—Ί Elixir wrapper for REST Countries API
Elixir
15
star
4

kakebo

πŸ“” A household finance ledger
Go
9
star
5

forecastr

⛅️ Ruby gem used to fetch data from openweathermap.org's API
Ruby
9
star
6

fteem.github.io

Static files for my Hugo blog
HTML
5
star
7

eight_ball

🎱 Elixir library simulating a Magic 8 ball.
Elixir
4
star
8

pbox

πŸ’Š CLI app I hope you never use. But if you do, it will help you not forget your medication.
Go
4
star
9

minitest-intro

Ruby
3
star
10

filex

Elixir wrapper for file.io's ephemeral file upload API πŸ—ƒ
Elixir
3
star
11

go-geoip

🌎 CLI tool for easy retrieval of geographical information about an IP/hostname
Go
3
star
12

fortune_teller

πŸ’»Repo for the purposes of the article Packing multiple binaries in a Golang package.
Go
3
star
13

hateoas

Ruby
2
star
14

auctionz

πŸ’Έ Dummy Rails 5.0.1 app built for demonstrating how API idempotency keys work, by using a Rails middleware and various storage solutions
Ruby
1
star
15

skopjeweather

Rake task that pulls weather data for Skopje and publishes it on Twitter.
Ruby
1
star
16

minitest-paste

Minitest plugin that uploads test failures in plain text for easier sharing
Ruby
1
star
17

EFP

Exercises from the book "Exercises for Programmers" by Brian P. Hogan, written in Golang.
Go
1
star
18

freakonomics

Freakonomics Radio CLI downloader
Ruby
1
star
19

hackerrank

Solutions to some of the HackerRank challenges, using Golang
Go
1
star
20

lgtm

πŸ–Ό Looks GIFFed To Me
Go
1
star
21

minitest-metz

Make sure your code (production and tests) obey Sandi Metz' four rules for developers.
Ruby
1
star
22

marver

Marver is a Ruby gem that makes it very easy to use Marvel's API.
Ruby
1
star