-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* New utility aliases (e.g. to cope with `main`/`master` branch difference) * Prefer `switch` over `checkout` * New aliases for working with remote `HEAD` * Configure mergetools and difftools * Other Git config improvements
- Loading branch information
Showing
11 changed files
with
218 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
git_config: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: Configure Git | ||
community.general.git_config: | ||
scope: global | ||
name: '{{ item.key }}' | ||
value: '{{ item.value }}' | ||
loop_control: | ||
label: "{{ item.key }}={{ item.value }}" | ||
loop: '{{ git_config | dict2items }}' |
10 changes: 10 additions & 0 deletions
10
provisioning/roles/git_helpers/files/git-develop-branch.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
command git rev-parse --git-dir &>/dev/null || exit | ||
for branch in dev devel development; do | ||
if command git show-ref -q --verify refs/heads/$branch; then | ||
echo $branch | ||
exit | ||
fi | ||
done | ||
echo develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
command git rev-parse --git-dir &>/dev/null || exit | ||
for ref in refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default}; do | ||
if command git show-ref -q --verify $ref; then | ||
echo ${ref##*/} | ||
exit | ||
fi | ||
done | ||
echo master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Copy Git helper scripts | ||
ansible.builtin.copy: | ||
src: '{{ item }}.sh' | ||
dest: '/usr/local/bin/{{ item }}' | ||
mode: 'u=rwx,go=rx' | ||
owner: root | ||
group: root | ||
loop: | ||
- git-develop-branch | ||
- git-main-branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
- dust | ||
- gh | ||
- git-delta | ||
- git-interactive-rebase-tool | ||
- lsd | ||
- procs | ||
- sd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters