-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.sh
More file actions
49 lines (40 loc) · 1.17 KB
/
functions.sh
File metadata and controls
49 lines (40 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# functions.sh
# Custom functions, aliases, and shell tweaks
# Navigation Aliases
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias ~='cd ~'
# Git Aliases
alias gs='git status'
alias gco='git checkout'
alias gb='git branch'
alias gp='git pull'
alias gP='git push'
alias gd='git diff'
alias gl='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit'
# Add this to your functions.sh file
# A function to add all changes, commit with a message, and push.
# Usage: gacp "Your commit message"
gacp() {
# Check if a commit message was provided
if [ -z "$1" ]; then
echo "Error: A commit message is required."
echo "Usage: gacp \"Your commit message\""
return 1
fi
echo "➡️ Adding all changes..."
git add --all
echo "➡️ Committing with message: \"$1\"..."
git commit -m "$1"
echo "➡️ Pushing to remote..."
git push
}
# Source multipass-utils.sh
if [ -f "$HOME/dotfiles/multipass-utils.sh" ]; then
source "$HOME/dotfiles/multipass-utils.sh"
fi
# Source core utils
if [ -f "$HOME/dotfiles/core-utils.sh" ]; then
source "$HOME/dotfiles/core-utils.sh"
fi