feat: add git and history utility functions
- Add branch, fc, and gitup functions - Update README documentation for new functions and abbreviations - Remove obsolete push-vim function
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
function branch --description 'Switch to or create a git branch'
|
||||
if not git rev-parse --is-inside-work-tree >/dev/null 2>&1
|
||||
echo "Not a git repo."
|
||||
return 1
|
||||
end
|
||||
|
||||
# Check if the branch already exists locally
|
||||
if git show-ref --verify --quiet refs/heads/$argv[1]
|
||||
git checkout $argv
|
||||
else
|
||||
# If it doesn't exist, create it
|
||||
git checkout -b $argv
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user