Skip to content

Instantly share code, notes, and snippets.

@etiennecollin
Last active November 28, 2022 22:06
Show Gist options
  • Save etiennecollin/f358d512656a1a829ec90263be63ba7c to your computer and use it in GitHub Desktop.
Save etiennecollin/f358d512656a1a829ec90263be63ba7c to your computer and use it in GitHub Desktop.
This small script will fetch and pull every repository that is cloned in the ~/github folder on my computer.
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Etienne Collin
# Date: 2022/11/25
# Email: collin.etienne.contact@gmail.com
import os
githubFolderPath = os.path.expanduser("~/github")
for repoName in next(os.walk(githubFolderPath))[1]:
print("\nUpdating: " + repoName)
os.system("cd " + githubFolderPath + "/" + repoName + " && git fetch && git pull")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment