-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit
More file actions
53 lines (47 loc) · 1.31 KB
/
git
File metadata and controls
53 lines (47 loc) · 1.31 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
50
51
52
53
alias gst="git status"
alias gc="git commit -m"
alias gca="git commit -am"
alias gd="git diff"
alias gap="git add python"
alias gcob="git checkout -b"
alias gco="git checkout"
gcd() { git commit -am '$(date)'; }
alias gcam="git commit --amend"
alias gitrm="git diff --diff-filter=D --name-only -z | xargs -0 git rm"
alias gb="git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/\1/p'"
alias gbd="git branch -d"
alias gbl="git branch"
alias git_un_commit="git reset --soft HEAD~"
#pulling
gclone() {
cd ~/dev
git clone $1
repo=${1%.git}
folder=${repo##*/}
cd $folder
}
git@() {
gclone git@$1
}
gpull() { git pull origin $(gb) }
get_main_branch() {
git branch -r | grep -E 'origin/HEAD' | sed 's/origin\/HEAD -> origin\///' | head -n 1 | xargs
}
alias gpm="git pull origin `get_main_branch`"
gw() {
git stash
gco `get_main_branch`
gpull
gcob $1
code .
}
alias gpmaster="git pull origin master"
alias gpmain="git pull origin main"
alias gitDELETEbranches="git branch | grep -v 'master' | grep -v 'main' | xargs git branch -D"
#pushing
alias gpo="git push origin"
git config --global core.excludesfile $DOTS/.gitignore_global
git config --global pull.rebase false
git config --global user.name "bhenry"
git config --global user.email "bhenry@campaignmonitor.com"
autoload -Uz compinit && compinit