-1

I'm trying to develop a script to iterate through a directory that holds about 60 git repositories. I would like to use Python to enter just the FIRST subdirectory (the repositories), copy in a file from a known, constant path, commit and push.

Mainly I need help figuring out how to access JUST the repositories and not go any deeper into the .git directory or the code projects.

C. Cannon
  • 39
  • 1
  • 6

1 Answers1

0

For python file/directory listing you could read this:

Directory listing in Python

For Python interacting with Git, you can give a try to this project:

https://github.com/gitpython-developers/GitPython

or simple use external process and manipulate the repository through git itself:

Calling an external command in Python

Yusef Maali
  • 2,201
  • 2
  • 23
  • 29