mynote/git/command.md
light jiang 9aed47964e update
2018-12-17 18:10:33 +08:00

17 lines
451 B
Markdown

# git command
## 强制拉取
``` bash:
git submodule update --init --recursive
git fetch --all
git reset --hard origin/master
git pull
```
## 统计代码量
```bash
git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --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
```