Skip to content

Instantly share code, notes, and snippets.

View Val-istar-Guo's full-sized avatar
😋
Happy

Guo Zhihao Val-istar-Guo

😋
Happy
View GitHub Profile
@Val-istar-Guo
Val-istar-Guo / expose_wsl_port.bat
Created April 17, 2022 12:47
将WSL的端口与电脑本机端口绑定
:: 删除之前的接口代理
netsh interface portproxy reset
:: 查询WSL的IP地址
for /f %%i in ('wsl hostname -I') do (
SET wsl_ip=%%i
)
:: 将本地端口与WSL的IP地址绑定
SET wsl_port=3000
[user]
name = your_name
email = your_email
[alias]
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
# View the current working tree status using the short format
s = status -s
p = pull
b = branch
@Val-istar-Guo
Val-istar-Guo / .Show Git Branch on Terminal.md
Last active March 1, 2017 05:18
Show Git Branch on Terminal

Show Git Branch on Terminal

Use

将.bash_profile文件中的内容复制到本地 ~/.bash_profile中即可。

Personalization

如果你不想使用xxxxxxx:BranchName 的形式,你可以修改 parse_git_branch函数中的sed命令。 对sed命令第二个-e后面的字符串中的/:\1/部分进行修改。两侧的反斜杠是一个界限,不要修改,也不要在此之外做修改。\1代表着BranchName前后添加你希望添加的字符就可以(使用转义字符请自行参考sed命令)。这些字符在非git项目的目录是不会显示的。

@Val-istar-Guo
Val-istar-Guo / uninstall-GHfM.sh
Created February 25, 2017 12:22
Completely uninstall GitHub for Mac
#!/bin/bash
function remove_dir () {
rm -rf "$1_"
if [ -d "$1" ]
then
mv "$1" "$1_"
fi
}