Search code examples
gitgithubbitbucket

Updating all repos in a folder?


I've got a folder - 'Repos' - which contains the repos that I'm interested in. These have been cloned from bitbucket, but I guess github could be a source too.

Repos
    - music-app
    - elephant-site
    - node-demo

Is there a git command that I can use which steps thru every folder in Repos and sees if there are new commits on the server, and the download the new stuff? And if there are new commits locally, then upload these.


Solution

  • Try this:

    cd repos
    find . -maxdepth 1 -type d -exec sh -c '(cd {} && git pull)' ';'