Last active
June 15, 2022 00:22
-
-
Save kindy/ad516da848e26722fc30962b94bd5285 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim:fdm=manual:sw=2:ts=2:et:ft=gitconfig: | |
[alias] | |
b = branch | |
ba = branch -a | |
c = commit | |
cf = config | |
ci = commit | |
co = checkout | |
dc = svn dcommit | |
df = diff | |
cd = diff --cached | |
gl = log --graph --pretty=format:'%h%Cred%d%Creset @%Cgreen%an%Creset %s [%ar]' | |
ll = log --pretty=format:'%h%Cred%d%Creset @%Cgreen%an%Creset %s [%ar]' | |
l2 = log --pretty=format:'%h%Cred%d%Creset @%Cgreen%an%Creset %s [%ai]' | |
glog = log --graph --pretty=oneline --abbrev-commit --color --decorate | |
l = log --decorate | |
m = merge | |
p = push | |
pl = pull | |
ps = push | |
psu = push -u origin HEAD | |
r = remote | |
rb = rebase | |
sb = show-branch | |
sfetch = !git svn fetch | |
sm = submodule | |
smu = submodule update | |
spl = !git svn fetch && git svn rebase | |
sps = !git svn dcommit | |
sr = svn rebase | |
st = status -uno | |
s = status --column | |
[color] | |
ui = auto | |
[push] | |
default = upstream | |
[user] | |
name = Kindy Lin | |
email = [email protected] | |
[pull] | |
ff = only | |
[core] | |
editor = vim -C | |
autocrlf = false | |
filemode = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias g='git' | |
alias ll='ls -l' | |
z() { | |
if [ $# = 0 ]; then | |
ls -GlFh | |
else | |
cd "$*" && ls -GlFh | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd ~/go/src/github.com | |
# https://github.com/wg/wrk | |
# https://github.com/wg/wrk.git | |
# [email protected]:valyala/fasthttp.git | |
url=$1 | |
if (echo -n $url | pcregrep '^https:' >/dev/null); then | |
d=$(echo -n $url | pcregrep -o '(?<=com/)[^/]+') | |
if (echo -n $url | grep '.git$' >/dev/null); then | |
echo -n '' | |
else | |
url="$url.git" | |
fi | |
elif (echo -n $url | grep ':' >/dev/null); then | |
d=$(echo -n $url | pcregrep -o '(?<=:)[^/]+') | |
else | |
# case valyala/fasthttp.git | |
d=$(echo -n $1 | pcregrep -o '[^/]+') | |
url="[email protected]:$1" | |
if (echo -n $url | grep '.git$' >/dev/null); then | |
echo -n '' | |
else | |
url="$url.git" | |
fi | |
fi | |
if [ ! -e $d ]; then | |
mkdir $d; | |
fi | |
cd $d; | |
git clone $url | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
goc -> https://github.com/x-motemen/ghq