-
Notifications
You must be signed in to change notification settings - Fork 0
/
.sshrc
68 lines (68 loc) · 1.83 KB
/
.sshrc
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
66
67
68
alias ..="cd .. && pwd && ls"
alias ...="cd ../.. && pwd && ls"
alias ....="cd ../../.. && pwd && ls"
alias ls="ls -F "
alias lsa="ls -aF"
alias lsl="ls -alF"
alias cp="cp -v"
alias mv="mv -v"
cdd () {
if [[ "$#" -eq 0 ]]; then
cd && pwd && ls
else
cd "$1" && pwd && ls;
fi
}
mkcd () {
mkdir -p -- "$1" &&
cd -P -- "$1"
}
testt () {
result=$(test "$@"; echo $?)
if [ $result == 0 ]; then
echo True
else
echo False
fi
}
alias sudo='sudo '
sudoe () {
sudo bash -c "$(declare -f $1); $@"
}
alias gac-Add-commit-and-push="git add . && git commit -v && git push origin master"
alias gak-Add-kommit-amend-and-push-force="git add . && git commit -v --amend --no-edit && git push -f origin master"
alias gko-kommit-amend-and-push-force="git commit -v --amend --no-edit && git push -f origin master"
alias gx="git status"
alias ga="git add"
alias ga.="git add ."
alias gap="git add -p"
gco () {
if [[ "$#" -eq 0 ]]; then
git commit -v
else
git commit -vm "$@"
fi
}
gca () {
if [[ "$#" -eq 0 ]]; then
git add .; git commit -va
else
git add .; git commit -vam "$@"
fi
}
alias gka="git add . && git commit -v --amend --no-edit"
alias gko="git commit -v --amend --no-edit"
alias gps="git push"
alias gc="git checkout"
alias gb="git branch"
alias gcb="git checkout -b"
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --reflog"
alias gll="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gsp-slave-pull="git fetch --all && git reset --hard origin/master"
alias grs="git reset --soft HEAD~1"
alias gr.="git reset ."
alias gcheckdangling="git fsck --unreachable --no-reflogs"
gprunedangling () {
git reflog expire --expire-unreachable=now --all
git gc --prune=now
}