Git
Git is a distributed version control system. It was created to aid in the development of the Linux kernel.
How to write commits
- First line: "when applied, this commit will…" (50 char limit)
- Can become subject line of an email
- text like "[PATCH linux-usb v2 0/13]" may get added to the beginning
- Second line empty
- Commit description at 72 columns (standard width of email)
- rationale for the change
- trade-offs and limitations of the approach
git-subrepo
git-subrepo is an alternative to git submodule
and git subtree
.
With a subrepo, operations on the main repo (e.g. cloning or commiting) work
transparently without the need of extra commands or the need of git-subrepo as a
dependency. Only when needing to push to the remote subrepo or pulling into the
local subrepo you need to use below commands (and git-subrepo
needs to be
installed).
How to use:
- While in main git repo, clone a remote repo as a subrepo
git subrepo clone <remote-url> [<subdir>]
- Push/pull changes with
git subrepo push/pull
Git over Email
Resources
- Start with Chapter 10 of Pro Git, then read ch. 2, 3, and 7. Rest is optional.
- Oh Shit, Git - Fixing common mistakes
- Flight rules for git