git 命令
git status
git pull
git branch
git branch -a
git remote show origin
git remote prune origin
git checkout <branch/tag>
git checkout -b <branch> origin/<branch>
git checkout -b <tag> <tag>
git log
git reflog
git config --edit --global
git reset --hard <commitid>
git push --force origin <远程分支名>
git log --since=2022-05-01 --until=2022-05-31 --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --since=2022-05-01 --until=2022-05-31 --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done
git log --since=2022-05-01 --until=2022-05-31 --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --since=2022-05-01 --until=2022-05-31 --author="$name" --pretty=tformat: --numstat | grep "\(.html\|.vue\|.js\|.less\|.css\|.json\|.md\)$" | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done
git log --since=2022-05-01 --until=2022-05-31 --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'
删除目录
rd <path> -Recurse
rm -rf <path>
查看权限
ls -l <path>
chmod 777 <path>
npm
npm config set registry https://registry.npm.taobao.org
npm ls
npm ls -g
npm ls -g --depth=0
查看端口占用
lsof -i:<port>
查看文件
cat [文件路径]
tail -n 10 [文件路径]
tail -n +10 [文件路径]
head -n 10 [文件路径]
cat [文件路径] | tail -n 10
cat [文件路径] | head -n 30 | tail -n +10
vim 命令
vim [文件路径]
i
esc
:
q
wq
q!
拷贝文件
scp -r [目录路径] [目标路径]
scp [文件路径] [目标路径]
scp [本机文件路径] [用户名@服务器地址:[目标路径]]