fixed wip
This commit is contained in:
parent
336fcaf702
commit
1394633521
1 changed files with 19 additions and 3 deletions
22
.zshrc
22
.zshrc
|
@ -323,12 +323,23 @@ __git__() {
|
|||
alias gm='git checkout main && git merge'
|
||||
alias gc="git clone --recurse-submodule"
|
||||
alias gd="git diff"
|
||||
alias ga="gd $1 && git add"
|
||||
# alias ga="gd $1 && git add"
|
||||
alias gp='echo "${CYAN}Updating submodules..${NC}" && git submodule update --init --recursive && echo "${CYAN}Pulling down submodules..${NC}" && git pull --recurse-submodule'
|
||||
alias gms='git maintenance start'
|
||||
alias gcm="git commit -m"
|
||||
alias gpu="git push --recurse-submodule=on-demand"
|
||||
|
||||
ga() {
|
||||
if [ -n "$2" ]; then
|
||||
git diff ${1:-.}
|
||||
git add ${1:-.}
|
||||
git commit -m "$2"
|
||||
else
|
||||
gd ${1:-.}
|
||||
git add ${1:-.}
|
||||
fi
|
||||
}
|
||||
|
||||
# ──────────────────────────────────────< functions >────────────────────────────────────
|
||||
gcl() {
|
||||
if [ -z "$2" ]; then
|
||||
|
@ -409,8 +420,13 @@ __git__() {
|
|||
|
||||
# Check if there are any changes on the remote branch
|
||||
if git diff --quiet "$branch" "origin/$branch"; then
|
||||
local commit_message="${1:-wip}"
|
||||
local commit_files="${2:-.}"
|
||||
if [ -n "$2" ]; then
|
||||
local commit_files="${1:-.}"
|
||||
local commit_message="${2:-wip}"
|
||||
else
|
||||
local commit_message="${1:-wip}"
|
||||
fi
|
||||
|
||||
echo "${CYAN}No changes on the remote branch. Adding changes and pushing with ${RED}${BOLD}'$commit_message'${NC}${CYAN} commit.${NC}"
|
||||
git add "$commit_files"
|
||||
git commit -m "$commit_message"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue