forked from jakearchibald/git-convenience
-
Notifications
You must be signed in to change notification settings - Fork 1
/
git-shortcuts.sh
executable file
·57 lines (50 loc) · 1.43 KB
/
git-shortcuts.sh
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
alias gs='git status'
alias gaa='git add -A'
alias gdiff='git diff --color-words'
alias gclean='git gc --prune=now && git remote prune origin'
alias glog='git log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit --date=relative'
if type git-up -t > /dev/null 2>&1; then
alias gup='git-up'
alias gp='git-up && git push'
else
alias gup='git pull'
alias gp='gup && git push'
fi
function gc {
git commit -am "$1"
gs
}
function goops {
git commit -a --amend
gs
}
function gwut {
#!/bin/bash
echo "
- - - - - - - - - - - - - -
Git Convenience Shortcuts:
- - - - - - - - - - - - - -
gwut - List all Git Convenience commands.
gs - git status
gaa - git add --all - Add all changes (including untracto staging)
gc "Message" - Commit all changes (except untracked) message
goops - Add changes to previous commit & edit comessage
gp - Pull then push - (does not use --rebase)
gup - Pull (not via --rebase)
glog - Decorated & graphed log
gdiff - A word-diff of changes
gclean - Compress & garbage collect data store
- - - - - - - - - - - - - -
Prompt Symbols:
- - - - - - - - - - - - - -
The prompt shows the current branch & among other helpful things:
* - Uncommitted changes
+ - Staged changes
% - Untracked files
< - You're behind the origin
> - You're ahead of the origin
<> - You've diverged from the origin
= - You're up-to-date with the origin
- - - - - - - - - - - - - -
"
}