0

I have a local directory with ten projects in it. I want to sync all ten projects with ten remote github repositories.

How would I accomplish this using git more efficiently than manually pushing all 10 individually one-at-a-time?

I am using Macbook Air running OSX Yosemite v.10.10.5

1 Answer 1

1

If all projects are in the same dir probably the most easy way is set up a shell script that iterate and push the projects one by one, here a simple example for Linux (I supposing that all projects are located in /home/mowzer/projects), if you are using Git for windows you should have a bash installed too but you must check how it map Windows disks and fix the path.

#!/bin/bash
PROJECTSDIR=/home/mowzer/projects/
for i in `ls $PROJECTSDIR`; do
    cd $PROJECTSDIR$i
    git push
done
2
  • +1. Thank you. This is what I was looking for. I would be happy to accept this answer but could you please either provide the code for Macbook Air running OSX Yosemite v.10.10.5 or point me to the documentation?
    – Mowzer
    Apr 14, 2016 at 20:50
  • 1
    I don't use OSX but as I remember it SHOULD have bash installed, you can check it with command whereis bash. It should return the path where bash is installed (like /bin/bash). If it's installed you must only fix PROJECTSDIR variable to match your filesystem
    – Tsumi
    Apr 14, 2016 at 20:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .