> For the complete documentation index, see [llms.txt](https://rodneycheung.gitbook.io/handbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rodneycheung.gitbook.io/handbook/2.-huan-jing-pian/gong-ju-bu-shu-he-shi-yong/ban-ben-kong-zhi/git/3.-jin-jie-ji-qiao/git_tricks.md).

# git技巧

## 一、git pull当前目录所有项目

在`~/.zshrc`或者`~/.bashrc`中加上以下内容:

```bash
alias git-pull-all="find . -maxdepth 3 -name .git -type d | rev | cut -c 6- | rev | xargs -I {} git -C {} pull"
```

然后执行`source ~/.zshrc`即可使用`git-pull-all`更新当前目录所有`git`项目。
