init .config git tracking
This commit is contained in:
commit
114c330966
151 changed files with 4688 additions and 0 deletions
11
config/fish/functions/__git.default_branch.fish
Normal file
11
config/fish/functions/__git.default_branch.fish
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
function __git.default_branch -d "Use init.defaultBranch if it's set and exists, otherwise use main if it exists. Falls back to master"
|
||||
command git rev-parse --git-dir &>/dev/null; or return
|
||||
if set -l default_branch (command git config --get init.defaultBranch)
|
||||
and command git show-ref -q --verify refs/heads/{$default_branch}
|
||||
echo $default_branch
|
||||
else if command git show-ref -q --verify refs/heads/main
|
||||
echo main
|
||||
else
|
||||
echo master
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue