Skip to content

Git commands in Hebra

Every Git command, and what it is in hb. Most are the same word with the same flags. A test (every_git_command_has_an_answer) checks this table against the git installed on the machine, so a command cannot go missing.

Three differences run through the whole table:

  • There is no staging area. Your files are already part of the change. hb add is accepted and does nothing.
  • Nothing stops half-way. A conflict is recorded in the change and the command finishes, so there is no --continue.
  • Everything can be undone. hb undo takes back any command, including reset --hard.

Everyday work

GitHebraNotes
git inithb initRecords the files already there.
git clonehb cloneFrom a Hebra server, a Git URL or a local path. --depth, --branch, --single-branch, --no-checkout, --recurse-submodules.
git addhb addDoes nothing: there is no staging area. For part of a file, hb commit -p.
git statushb status-s, --porcelain, -b.
git diffhb diffA B, A..B, A...B, --stat, --name-only, --name-status, -U<n>, -- <paths>.
git commithb commit-m, -F, -p, --amend, --author, --date, --fixup, --squash, -S, --no-verify, and paths.
git restorehb restore--source.
git resethb reset--soft, --mixed, --hard.
git rmhb rm-r, --cached.
git mvhb mv
git cleanhb clean-n, -f, -x, -X.
git stashhb stashpush, pop, apply, list, show, drop, clear, branch.
git loghb log--oneline, --graph, -p, --stat, --author, --since, --until, --grep, -G, -S, --follow, --first-parent, --merges, --reverse, --format.
git showhb showAlso rev:path.
git blamehb blameAlso names the agent, task and prompt of each line (--json).
git annotatehb annotateSame as blame.
git grephb grep-i, -w, -F, -l, -c, -v, a revision.
git shortloghb shortlog-s, -e.
git describehb describeWithout -m. With -m it sets a change's description.
git whatchangedhb loghb log --stat.

Branches and tags

GitHebraNotes
git branchhb branch-d, -m, -f, -a, -r, --contains, --merged, --no-merged, --show-current. Branches are called bookmarks too.
git switchhb switch-c, --detach. Uncommitted work comes along.
git checkouthb checkout-b, and -- <paths> to restore files.
git taghb tag-a, -m, -s, -d, -f, -l, --contains, -v.
git worktreehb worktreeadd, list, remove, prune. These are Hebra workspaces.

Combining and rewriting

GitHebraNotes
git mergehb merge--no-ff, --ff-only, --squash, -s ours, -X ours, -X theirs. Follows renames.
git rebasehb rebase-d/--onto, -s, -r, -b, -i, --todo, --autosquash.
git cherry-pickhb cherry-pickRanges, -n, -x, -m.
git reverthb revertRanges, -n, -m.
git range-diffhb range-diff
git rererehb undoNot needed: a resolved conflict stays in the change, and rebasing it again keeps the resolution.
git filter-branchhb filter--remove, --keep.
git replacehb editChange the commit itself: descendants follow and hb undo works.

Sharing

GitHebraNotes
git fetchhb fetch--all.
git pullhb pull--rebase, --merge, --ff-only.
git pushhb pushBranch names, --force, --tags, --all, --delete, -u.
git remotehb remoteadd, list, remove, set-url, rename.
git format-patchhb format-patchGit's am reads them.
git amhb amReads Git's patches.
git bundlehb bundlecreate, unbundle, list-heads, verify.
git archivehb archivetar, tar.gz, zip, --prefix.
git request-pullhb reviewhb review open.
git send-emailhb format-patchPatches are plain mail: send them with any mail tool.
git imap-sendhb format-patchSame.
git noteshb notesadd, show, list, remove.
git submodulehb submoduleadd, update --init, status, foreach.
git sparse-checkouthb sparseset, add, list, disable.
git backfillhb fetchPartial clones read file contents on demand.

Debugging and care

GitHebraNotes
git bisecthb bisectstart, good, bad, skip, run, log, reset.
git fsckhb fsck
git gchb gc--auto, --prune, --expire-ops.
git maintenancehb gchb gc --auto.
git repackhb gc
git prunehb gc--prune now.
git pack-refshb gcReferences live in one database, so there is nothing to pack.
git count-objectshb count-objectsSame as hb stats.
git refloghb reflogThe operation log. hb op log, hb op show, hb op restore.
git refshb for-each-ref
git show-branchhb show-branch
git verify-commithb verify-commitGnuPG or SSH keys, with Git's settings.
git verify-taghb taghb tag -v <name>.
git confighb config--global, --list, --unset. Also git config user.name as a fallback.
git mergetoolhb mergetoolmerge.tool.
git difftoolhb difftooldiff.tool.
git merge-treehb mergeConflicts never block, so a trial merge is hb merge and then hb undo.
git diagnosehb fsck
git bugreporthb fsck
git surveyhb stats
git helphb help
git versionhb versionhb --version.
git scalarhb clone--filter=blob:none, hb sparse. Large repositories are the default case: no special mode.

Scripts

GitHebra
git rev-parsehb rev-parse
git rev-listhb rev-list
git merge-basehb merge-base
git for-each-refhb for-each-ref
git show-refhb show-ref
git name-revhb name-rev
git ls-fileshb ls-files
git ls-treehb ls-tree
git cat-filehb cat-file
git cherryhb cherry
git fast-exporthb git export
git fast-importhb git import

Every command also takes --json, with errors that carry a stable code.

Not repeated in Hebra

GitInstead
git gui, git citool, git gitk, git gitweb, git instawebThe web hub, which comes with hebra-server.
git svn, git p4, git archimport, git cvsimport, git cvsexportcommit, git cvsserver, git quiltimportBring the history into Git with them, then hb clone it.

Edit this page