日常中会使用到很多好用的命令,在这里记录一下
迁移仓库时保留部分commit历史
repo a -> repo b
想要将a仓库的部分代码迁移到b仓库中,并保留commit
pip3 install git-filter-repo
workspace a
git clone a
cd a
git filter-repo --path src/xxx
git remote add remote_b
git checkout -b add_xxx-tmp
git push --set-upstream remote_b add-xxx-tmp
workspace b
git pull
git checkout -b add-xxx
git merge origin/add-xxx-tmp --allow-unrelated-histories
git push --set-upstream origin add-xxx
模拟http 0.9 server
http0.9没有请求体,没有响应头,请求头也很简单,现在简单的http server都默认是1.0及以上的了
GET /1.html
使用socat进行server的模拟
socat TCP-LISTEN:7778,fork EXEC:'echo "Hello, HTTP/0.9!"'
使用curl发送http 0.9的流量
curl --http0.9 http://127.0.0.1:7778 -vv