-
Notifications
You must be signed in to change notification settings - Fork 0
/
.git_things
65 lines (56 loc) · 1.71 KB
/
.git_things
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
54
55
56
57
58
59
60
61
62
63
64
65
# Git fun
alias gst='git status'
alias gf='git fetch'
alias gp='git pull'
alias gpf='git push --force-with-lease'
alias grem='git fetch; [[ "$(basename "$PWD")" == "upstart_web" ]] && git rebase origin/master || git rebase origin/main'
alias gcm='git checkout master'
alias gco='git checkout'
alias gb='git branch | tail -n 100 | grep -v master'
alias gd='git diff'
alias ci='git commit -m' # requires you to type a commit message
function gup() {
git fetch
git rebase origin/master
git push --force-with-lease
}
function guppush() {
git fetch
git rebase origin/master
git push --force-with-lease
}
function openpr() {
# Uses Github CLI
gh pr view -w
}
function createpr() {
branch_name=`git symbolic-ref HEAD | cut -d"/" -f 3,4`;
open https://github.com/teamupstart/upstart_web/pull/new/$branch_name
}
function creategdpr() {
branch_name=`git symbolic-ref HEAD | cut -d"/" -f 3,4`;
open https://github.com/teamupstart/greendot/pull/new/$branch_name
}
function createmspr() {
branch_name=`git symbolic-ref HEAD | cut -d"/" -f 3,4`;
open https://github.com/teamupstart/mobile/pull/new/$branch_name
}
function createuwfpr() {
branch_name=`git symbolic-ref HEAD | cut -d"/" -f 3,4`;
open https://github.com/teamupstart/upstart-web-frontend/pull/new/$branch_name
}
# Alternatively, you can go with git add . && git commit --amend --no-edit
# if you don't want to edit the commit message
function smooshgit() {
git commit -m "WIP"
git rebase --interactive HEAD~2
}
# I don't really use these
alias ga='git add'
alias gap='git add -p'
alias gbl='git blame -w -M -C'
alias gdm='git diff master'
alias amend='git commit --amend --no-edit'
alias gpu='git push'
alias staged='git diff --cached'
alias gl="git l"