-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc
More file actions
23 lines (18 loc) · 700 Bytes
/
bashrc
File metadata and controls
23 lines (18 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export EDITOR=vim
# git
#alias gitsub="git submodule init && git submodule update --recursive"
function gac() {
git commit -am "$1"
}
function gitDeleteLocalBranches() {
git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done
}
function randomStr() {
# cat /dev/urandom | tr -cd ${2:-'a-zA-Z0-9'} | fold -w ${1:-8} | head -n 1
tr -cd ${2:-'a-zA-Z0-9'} < /dev/urandom | head -c ${1:-8}
}
function releaseTag() {
tag_name="release-`date +"%Y-%m-%d"`${1}"
git tag -am "Release: ${2}" "$tag_name"
git push "$(git remote)" "$tag_name"
}