:octocat:+md=:heart: 来自你的 git 日志的精彩教程
Generate step-by-step markdown tutorials from your git history
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
npm i -g nodegit
npm i -g git-tutorgit-tutor . > README.mdThat's fine, I don't like it either. You can use git add -p and split your work into smaller chunks later
# as a comment by defaultTo be able to use this symbol and add headings you should reconfigure git cleanup symbol
git config commit.cleanup whitespaceGit allows commits without any content
git commit --allow-emptyWriting 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
code command in $PATH (Shift + CMD + P => Search for PATH)git config core.editor "code --wait"You can pass --no-status flag to a commit command, this will strip those commented lines
git commit --no-statusYou can also use your custom commit template:
~/.gitmsg)git config commit.template ~/.gitmsg暂无开放 Issues,或尚未同步最近议题。