github-best-practice

Links to GitHub best practice articles/blogs etc.

View the Project on GitHub widdowquinn/github-best-practice

GitHub Best Practices

This document is a collection of links to advice and best practice for maintaining GitHub repositories. My intention is to have this as an open resource for students, etc. to refer to and update.

XKCD git - don't be like this!

tl;dr

Repository organisation

Day-to-day working

Workflow

XKCD git commits

Use the Source!

Useful .gitconfig aliases

alias.lol=log --graph --decorate --pretty=oneline --abbrev-commit
alias.lola=log --graph --decorate --pretty=oneline --abbrev-commit --all
alias.hist = log --graph --pretty=format:'%h %ad | %s%d [%an]' --date=short

Useful hints

Oh no! I’ve deleted a bunch of files, but without using git rm! How do I avoid typing all those filenames in?

Ack! I’ve made my changes in a local branch (issue_X), issued a PR remotely, merged the PR, and deleted the issue_X branch locally - but it’s still showing up in git branch -a or git lola!

Useful quotes

I have certain mantras that I use to guide my programming. They generally revolve around this theme: “Thinking is hard, and I’m not very good at it; every block of code should be simple and obvious, because if it makes me think, I’ll probably screw it up and break something.” - Remy Porter