From 28e41e78c11e555694b0023d97f6518758e53397 Mon Sep 17 00:00:00 2001 From: OCram85 Date: Tue, 8 Nov 2022 16:06:51 +0100 Subject: [PATCH] add system gitconfig (#4) #### :book: Summary - uses system gitconfig for prepared config. #### :bookmark_tabs: Test Plan > :bulb: Select your test plan for the code changes. - [x] Tested via Drone.io pipeline - [ ] Custom test - [ ] No test plan ##### Details / Justification #### :books: Additional Notes Co-authored-by: OCram85 Reviewed-on: https://gitea.ocram85.com/CodeServer/Container/pulls/4 --- Dockerfile | 4 +++- gitconfig-system | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gitconfig-system diff --git a/Dockerfile b/Dockerfile index f4a7e6d..a5bbb0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,9 +9,11 @@ ENV STARSHIP_CONFIG=/etc/starship.toml COPY starship.toml /etc/starship.toml +ADD gitconfig-system /etc/gitconfig RUN \ echo "**** setup git ****" && \ - git config --system credential.helper store && \ + # using prepared systemwide config file instead. + #git config --system credential.helper store && \ echo 'source /usr/share/bash-completion/completions/git' >> /etc/bash.bashrc ADD install-devruntime /usr/bin/ diff --git a/gitconfig-system b/gitconfig-system new file mode 100644 index 0000000..8236fd9 --- /dev/null +++ b/gitconfig-system @@ -0,0 +1,37 @@ +[core] + editor = code-server --wait + autocrlf = False + +[credential] + helper = store + +[i18n] + filesEncoding = utf-8 + +[push] + default = simple + +[alias] + # simplified logging views + lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all + lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all + + # fetch all remote changes + cfetch = fetch --prune --tags + + ## Phabricator inspired workflow + + # Create new feature branch + feature = "!f(){ b=$1; git checkout master; git pull; git checkout -b "$b" master; };f" + + # adds a new wip commit + wip = !"git add -A; git commit -m '[WIP]'" + + # used to squish changes in the latest commit. Should be used after a wip commit + squish = !"git add -A; git commit --no-edit --amend" + + # Push to origin / dev branch + pod = !"git push origin dev" + + # Push to custom remote branch + poc = "!f(){ b=$1; git push origin "$b";};f"