Cli Tools

Feb 21st, 2020 - Now

git

如何迁移当前更改到新的分支

Ref: git 将当前分支上修改的东西转移到新建分支 优雅的解决方案:压栈更改再弹出更改

  1. 在修改的分支上 git stash 可以将当前更改的结果压栈到临时保存区内

  2. 新建分支 git checkout -b new_branch

  3. 将当前的临时保存弹出 git stash pop

git clone 慢

通过代理可以加快速度: 临时:

git clone -c http.proxy="http://127.0.0.1:1080" repourl

永久:

git config --global http.proxy "http://127.0.0.1:1080"

效果对比:

Before: 4.00 KiB/s
After:  1.82 MiB/s

npm

nrm

Description: source controller for npm

Install:

(sudo) npm install -g nrm Admin rigths required.

Usage:

  1. nrm ls : check all sources

  2. nrm add [name] https://address : add new source

  3. nrm del [name] : delete a source

  4. nrm use [name] : switch to a source

  5. nrm test : test the speed of all sources

vue

sudo npm install -g @vue/cli

ag

Ubuntu

保存并运行

set -x
TEMP_DIR=$(mktemp -d Leslie.Guan.XXXXXX)
cd ${TEMP_DIR}
wget https://github.com/ggreer/the_silver_searcher/archive/master.zip
TAR_DIR=$(unzip *.zip)
TAR_DIR=${TAR_DIR%%/*}
TAR_DIR=${TAR_DIR##*:}
cd ${TAR_DIR}
apt-get install -y automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev --force-yes
./build.sh && make install
cd ../../
rm -rf ${TEMP_DIR}
ag -V
set +x

yum

yum install the_silver_searcher

macOs

brew install the_silver_searcher

grep

linux grep 查看指定内容上下几行

Last updated