Hidden manuals: gittutorial, giteveryday, gitglossary, gitworkflow
Today I discovered a set of wonderful and slightly hidden manuals on git:
man gittutorial
man giteveryday
man gitglossary
man gitworkflow
Actually they aren’t all that well hidden if an observant user just started poking at git: $ man git
GIT(1)
...
DESCRIPTION
Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.
See gittutorial(7) to get started, then see giteveryday(7) for a useful minimum set of commands. The Git User’s Manual[1] has a more in-depth introduction.
...
SEE ALSO
gittutorial(7), gittutorial-2(7), giteveryday(7), gitcvs-migration(7), gitglossary(7), gitcore-tutorial(7), gitcli(7), The Git User’s Manual[1], gitworkflows(7)
...
39 comments
[ 3.2 ms ] story [ 83.2 ms ] threadhier - Explains the filesystem layout
ascii - An ASCII table
builtins - Things your shell does without external binaries
signal - Includes a table of all the signal numbers
I was never able to read the entirety of man bash though
>builtins - Things your shell does without external binaries
My OpenSUSE install doesn't have builtins. I just look in bash(1).
>signal - Includes a table of all the signal numbers
Specifically signal(7)
However, I just can’t really parse man pages. I’ve never sat down and just figured out the numbering scheme and how to efficiently read/parse them.
Occasionally I’ll read a man page online, but a quick blog post seems to be an easier reach, or even GPT these days.
For example, hier: https://linux.die.net/man/7/hier
—
Also, a good opportunity to complain about -h/--help flags not being universally recognized by bins.
https://www.man7.org/linux/man-pages/man1/man.1.html
I've written my fair share of documentation, too. E.g.: http://python-forge.readthedocs.io
It might be that manpages lack links, and it's hard to hop back and forth, as I can't set markers like in vim, so my controls are just up/down.
Navigating longer man pages does seem to be somewhat clumsy, though, and finding things in something massive such as the gcc man page takes work. I'm probably just used to it enough that I don't always even realize it.
https://man7.org/linux/man-pages/dir_section_3.html
sysexits(3) - meaningful exit codes
style(9) - C coding style
style.Makefile(9) - other coding styles (here, Makefile)
`apropos` only searches short descriptions. But `man -K` let's you search all conent of man pages.
> now you "just" need to remember that apropos is a thing...
man has apropos built-in (`man -k`) and calls out `apropos` directly in its help message and its man page, so `man man` will reveal that as well as `man --help`.
You want to learn about UNIX? Start by visiting /{,usr}/{,s}bin of a base install (the beauty of the split), and look at what each present binary does by reading its manpage and actually following those SEE ALSO mentions.
And suddenly you'll feel well equipped to cough out a lot more one-liners without having to drop down to bashisms...
[1]: packaged in `debian-goodies` on Debian, `bikeshed` on Ubuntu, or I have this version patched for macOS (might work on BSD or other Unices, too): https://gist.github.com/notpushkin/6e9b2e232b9cd5e1e35600c5e...
(also note that it's "gitworkflows", with an s at the end)
[1] I am definitely not, so I've missed it myself.
http://www.catb.org/esr/reposurgeon/
1. Make sure all branches touch separate files. I would strongly recommend git-filter-repo over git-filter-branch. It's way simpler to use and orders of magnitudes faster.
2. Generate the list of commits in the correct order:
git rev-list --date-order --reverse branchA BranchB BranchC > revisions.txt
3. Go to any branch and: git rebase -i --root --force-rebase
Paste the contents of revisions.txt into the sequence editor and add "p " at the bigging of every line. Run the rebase and you are done.
-----
#!/bin/bash
if [[ ! -f "$1" ]]; then
exit 1
fi
git rev-list --no-merges --date-order --reverse $(git branch -a | grep -v '*' | grep master) | awk '{print "p " $0}' > $1
exit 0
-----
Then I can just:
-----
pushd monorepo
GIT_SEQUENCE_EDITOR=../inject_reflist.sh git rebase -i --root --force-rebase
popd
-----
And off we go! Apparently there were a few branches + merges, and we have some ongoing feature branches, so I need to find a way to bring in branches other than master as well, preferably while conserving the merges as-is, instead of skipping them like I do above.
If, like I often am, you are just after examples for a command you've used many times but forgotten common flags for (-r or -R?!), the online resource:
will work in your terminal, minimum of fuss. There's the option of self-hosting it (docker based) if you are regularly working in an offline/lab environment.Section 5 also has some gems: elf(5), termcap(5), etc.
For me this is the only known instance where single-dash single-char argument (-h) does something different than its double-dash verbose counterpart (--help).