arkanum/docs/guide/components/git.md

2.8 KiB

Git

🔱 Config files

The git configuration is usually done in these 3 different contexts:

  • system wide config
    • /etc/gitconfig
  • global (per user) config
    • ~/.gitconfig
  • local (per repository)
    • <repo-root>/.git/config

The final config will be merged in this order.

[!TIP] 💡 TIP You can display the final values with git config --list

📄 Included Config

We already modified the default system config file:

Key Section Description
editor [core] Defines code-server as git edit to open files.
autcrlf [core] Disables automatic line ending conversion. Should be handeled by the editor
helper [credential] Enables saving plain credentials for git remotes.
filesEncoding [i18n] Sets utf-8 as default encoding.
default [push] Uses simple branch name matching strategy.
lg1 [alias] Adds alternate log output layout in graph style
lg2 [alias] Adds extended graph log layout.
cfetch [alias] Adds alias for fetch with --prune and --tags . cfetch stands for clean fetch

There are also some Phabricator workflow inspired helpers:

Key Section Description
feature <branch> [alias] Starts a new feature branch from updates master and checks out the new branch.
wip [alias] Stages all current changes and creates a wip (work in progress) commit.
squish [alias] Takes all open workdir changes and add them to the latest commit.
pod [alias] Tries to push current branch to origin/dev.
poc <branch> [alias] Takes current branch and tries to push it to a new remote one.

::: details /etc/gitconfig <<< @/../gitconfig-system{ini:line-numbers} :::

Git bash Completion

Git bash completion is already enabled in the arkanum image:

<<< @/../Dockerfile#git{Dockerfile}