• Stars
    star
    385
  • Rank 111,464 (Top 3 %)
  • Language
    JavaScript
  • License
    Other
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

:octocat:+md=❤️ Awesome tutorials from your git log

Git Tutor

lesnitsky.dev Build Status GitHub stars Twitter Follow

Git Tutor Logo

Generate step-by-step markdown tutorials from your git history

Motivation

There is tons of tutorials on medium, personal blogs etc. Writing detailed and complete guide how to build things is kinda hard and people are lazy, so those tutorials sometimes incomplete, code examples don't work as-is (some "prerequisite" step was not included in tutorial), sometimes it walks you through only some pieces of code and you can find the rest in repo. But you have no idea how the rest works.

Git is a perfect tool to build smth incrementally (commits). git-tutor walks through commit history and generates markdown, placing commit message first, content of a commit afterwards. Write markdown to your commit messages – have a nice tutorial later with single command

Example tutorials

Some rules

  • keep commits small and explain almost every line of code you're writing
  • write markdown to your commit messages
  • don't skip anything. Simple copy-paste should work to reproduce the result of your tutorial
  • writing code is fun. Explaining how code works is even more of fun

Installation

npm i -g nodegit
npm i -g git-tutor

Usage

git-tutor . > README.md

Tips and tricks

I don't like commiting every line of code. What should I do to keep tutorial clean?

That's fine, I don't like it either. You can use git add -p and split your work into smaller chunks later

Git treats # as a comment by default

To be able to use this symbol and add headings you should reconfigure git cleanup symbol

git config commit.cleanup whitespace

What if I want to leave general comment/explanation without any code

Git allows commits without any content

git commit --allow-empty

How to use my favorite editor for writing markdown

Writing a lot of markdown is not really convenient in default git editor like vi, I prefer doing it in vscode as it allows to preview parsed markdown with all styling applied. To use vscode as git editor

  • Install code command in $PATH (Shift + CMD + P => Search for PATH)
  • git config core.editor "code --wait"

Default commit message template contains status in comment, how to remove it

You can pass --no-status flag to a commit command, this will strip those commented lines

git commit --no-status

You can also use your custom commit template:

  • create empty file and place it somwhere in your file system (e.g. ~/.gitmsg)
  • git config commit.template ~/.gitmsg

Unsolved issues

  • i18n (cherry-pick to new locale branch with translation?)
  • updates to previous commits (rebase works, but not convenient)
  • collobaration

LICENSE

WTFPL

lesnitsky.dev GitHub stars Twitter Follow

More Repositories

1

flutter_localstorage

📦flutter localstorage for ios/android/desktop/web
Dart
279
star
2

react-native-webview-messaging

✉️ Send/Receive data between React Native app and WebView
JavaScript
264
star
3

howtodothisinflutter

📄Flutter cheat sheet
JavaScript
262
star
4

webgl-month

🎓 Daily WebGL tutorials
JavaScript
211
star
5

native_context_menu

Native context menu for Flutter apps
C++
157
star
6

flutter_desktop_plugins

Flutter desktop plugins
Ruby
50
star
7

fps_jank_flash_widget

🟥 A flutter widget that flashes when flutter fails to render a frame in a certain timeframe
C++
34
star
8

local_assets_server

📦 Local server which serves assets to WebView
Dart
29
star
9

events2

ES2015 implementation of nodejs EventEmitter
JavaScript
28
star
10

editorconfig-cli

📝🔧 initialize .editorconfig in your terminal
JavaScript
27
star
11

front-end-interview

Front-end interview questions
27
star
12

infinite_view_pager

📜Infinite View Pager widget for Flutter
Dart
26
star
13

bloc_auth_tdd

❌✅Refactor BloC
HTML
26
star
14

guard

🛡try/catch with default value in case of exception or result is null
Dart
23
star
15

dynamic_app_icon

Set any widget as an app icon! (macOS only)
Dart
21
star
16

tic-tac-toe

An example tutorial built with git-tutor https://github.com/lesnitsky/git-tutor
JavaScript
20
star
17

network_state

🌎 Service aware network state plugin
Dart
20
star
18

inherited_builder

🤖Autogenerated state management and dependency injection with inherited widgets
Dart
15
star
19

editr

📝Simple text editor
TypeScript
13
star
20

my-setup

List of apps and tools I use
12
star
21

flutter_code_evenings

🌙Flutter Code Evening event series repo
Dart
11
star
22

pure_widget

Base Flutter widget which triggers rebuild only of props changed
Dart
9
star
23

fps_widget

FPS Widget for Flutter
Dart
9
star
24

microfrontends

Dart
9
star
25

null_widget

☁️ Lightweight placeholder widget for flutter
Dart
8
star
26

deep_map

getDeep and setDeep for dart maps
Dart
7
star
27

level_db

LevelDB for Flutter
Dart
7
star
28

new-tab

➕ Minimalistic chrome new tab
JavaScript
6
star
29

perf_timer

⏱Perf timer for dart and flutter
Dart
6
star
30

redux-saga-chai

Chai extension for testing sagas
JavaScript
5
star
31

cognito-github-oidc

GitHub OAuth openid shim for AWS Cognito
TypeScript
5
star
32

lifecycle_widget

widget with lifecycle hooks for flutter
Dart
5
star
33

dart_libgit2

Dart bindings to libgit2
Dart
5
star
34

nodejs-workshop

JavaScript
5
star
35

contextualized

Context is a HashMap with shadowing (inherits parent values) and helpers to work with Types as keys
Dart
4
star
36

matches

Collection of useful patterns for Dart
Dart
4
star
37

dash_3d

Dart
4
star
38

flutter_learners_app

Dart
4
star
39

notifications_stream

Utility widget which writes notifications into stream
Dart
4
star
40

license

CLI license generator
Dart
3
star
41

flutter_env_vars

📦Container for environment variables
Dart
3
star
42

flutter_interview_questions

3
star
43

flutter_ts

TypeScript
2
star
44

tdlib_bindings

Telegram Database Library ffi bindings for dart
Dart
2
star
45

dart-docker-server-starter

A preconfgiured template for dockerized dart server apps
Dart
1
star
46

http_routes

↪Utility to match http requests with routes
Dart
1
star
47

ui_paragraph

Dart
1
star
48

sls-starter

Template for serverless APIs with typescript and dynamodb
TypeScript
1
star
49

http_sugar

🍭Sugar methods for HttpRequest and HttpResponse
Dart
1
star
50

0110011001110000

Haskell
1
star
51

alfred-workflows

🎩Alfred workflows I use
1
star
52

shields

Generates shields for your readme
Dart
1
star
53

domainavailable

Want new sexy domain? Check whether it is available
JavaScript
1
star
54

readme

Generates README for your flutter package
Dart
1
star
55

try-nexus

Does nexus.js work?
CoffeeScript
1
star
56

lgi-hackathon-service

JavaScript
1
star
57

tmpl

Dart
1
star
58

lang_ui

Dart
1
star
59

flutter_context

React-like Context API for Flutter
C++
1
star
60

sweetdream

Nightmare.js with single electron main process
JavaScript
1
star
61

flutter_firebase_chat

GDG 2020-02-07 Meetup Demo
Dart
1
star
62

node-ts-express-docker-starter

Pre-configured Node.js app with Typescript, Express and Docker
TypeScript
1
star
63

serverless-plugin-resource-deep-merge

Serverless plugin which allows updating CloudFormation template
JavaScript
1
star
64

tokenizer

Converts a stream of strings into stream of tokens splitted by delimiters
Dart
1
star