From f0ed8873f68829d047939770fb27ef530bd4db91 Mon Sep 17 00:00:00 2001 From: hhhh hgfh Date: Tue, 29 Sep 2026 13:04:10 +0300 Subject: [PATCH] feat: add gitconfig settings to dots --- git/.gitconfig | 14 ++++++++++++++ git/aliases.gitconfig | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 git/.gitconfig create mode 100644 git/aliases.gitconfig diff --git a/git/.gitconfig b/git/.gitconfig new file mode 100644 index 0000000..84c351a --- /dev/null +++ b/git/.gitconfig @@ -0,0 +1,14 @@ +[include] + path = ~/Git/Custom-environment/git/aliases.gitconfig + +[core] + editor = nvim + +[init] + defaultBranch = master + +[pull] + rebase = true + +[rebase] + autoStash = true diff --git a/git/aliases.gitconfig b/git/aliases.gitconfig new file mode 100644 index 0000000..6c94d1b --- /dev/null +++ b/git/aliases.gitconfig @@ -0,0 +1,32 @@ +[alias] + st = status + sw = switch + br = branch + co = checkout + ci = commit + + lg = log --graph --decorate --oneline --all + + up = "!git switch master && git pull" + + update-master = "!f() { \ + branch=$(git branch --show-current) || exit 1; \ + [ -n \"$branch\" ] || { echo 'Detached HEAD'; exit 1; }; \ + git switch master && \ + git pull && \ + git switch \"$branch\"; \ + }; f" + + rebase-master = "!f() { \ + branch=$(git branch --show-current) || exit 1; \ + [ -n \"$branch\" ] || { echo 'Detached HEAD'; exit 1; }; \ + [ \"$branch\" != \"master\" ] || { \ + echo 'Already on master'; \ + git pull; \ + exit $?; \ + }; \ + git switch master && \ + git pull && \ + git switch \"$branch\" && \ + git rebase master; \ + }; f"