Skip to content

Instantly share code, notes, and snippets.

@gin-melodic
Last active July 31, 2025 13:09
Show Gist options
  • Select an option

  • Save gin-melodic/08fd914edecd327bf2d51fbc367636bc to your computer and use it in GitHub Desktop.

Select an option

Save gin-melodic/08fd914edecd327bf2d51fbc367636bc to your computer and use it in GitHub Desktop.
Batch `git pull` in sub folder
#!/bin/bash
ls -d */ | xargs -I {} bash -c 'cd "{}" && echo "Now in {}" && git pull'
@gin-melodic
Copy link
Author

Also use for batch pip install.

ls -d */ | xargs -I {} bash -c 'cd "{}" && echo "Now in {}" && pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt'

@gin-melodic
Copy link
Author

for windows.

Get-ChildItem -Directory | ForEach-Object { pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r "$($_.FullName)\requirements.txt" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment