-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
82 lines (67 loc) · 1.64 KB
/
.bashrc
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# [ -f ~/bin/win-sudo/s/path.sh :] && source ~/bin/win-sudo/s/path.sh
# PS1="$(tput setaf 2)\u$(tput setaf 5)@\h \W -> $(tput sgr0)";
# export PS1;
# # export FGRED=$(tput setaf 1);
#No systemd config as wsl too can provide you linux utilities only smh :/
#cd into most used projects folder
alias cdp="cd /D/projects/"
# Aliases
alias gs="git status"
alias gaa="git add ."
alias ga="git add"
alias gd="git diff"
alias gc="git clone $1"
alias gcm="git commit -m $1"
alias gl="git log"
alias gps="git push origin"
alias gpl="git pull origin"
alias gpsu="git push --set-upstream origin"
alias gar="git remote add origin"
alias gprb="git pull --rebase origin"
alias rnb="yarn react-native run-android"
alias gr="git reset --hard HEAD"
#Overwriting local changes
function pull_force() {
git reset --hard HEAD
git pull --rebase origin $1
}
#Keeping local changes
function pull_stash() {
git fetch --all
git stash
git merge @{u}
git stash pop
}
#Adding,committing and pushing files
function gg() {
ga "$1" || gaa
gcm "$2"
gps
}
#Hosting local files
function filehost() {
curl -T "$1" -Lv station307.com 2>&1 | grep located-at
}
#Knowing current branch
function git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# Colors
red=$(tput setaf 1);
green=$(tput setaf 2);
yellow=$(tput setaf 3);
blue=$(tput setaf 4);
magenta=$(tput setaf 5);
cyan=$(tput setf 6);
bold=$(tput bold);
reset=$(tput sgr0);
PS1="\[${bold}\]\n";
PS1+="\[${green}\]\u";
PS1+="\[${magenta}\] at ";
PS1+="\[${cyan}\]\h";
PS1+="\[${blue}\] in ";
PS1+="\[${green}\]\w";
PS1+=${git_branch};
PS1+="\n";
PS1+="\[${reset}\]\$ \[${reset}\]";
export PS1;