Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to git pull for multiple repos on windows?

Tags:

So I have a lot of repos, and sometimes I forget if some are behind on their pulls, so I was wondering there was a way to git pull for each repo in one .bat script. I saw someone do it for linux I believe here, but I'm on a windows machine. Does anyone know how to do this for windows?

like image 392
ROODAY Avatar asked Jun 14 '14 19:06

ROODAY


People also ask

Can you have multiple repositories in git?

With Git, using multiple repositories is the only way to work efficiently. This enables each team to work independently, and do their work faster. You can also make sure that developers only have access to the repositories they need access to (thus making Git more secure.)

How do I add all repositories to a git repository?

You can make a .bat file in which you add all the repositories yourself with this cd C:\path o\gitepo call git pull cd C:\path o\gitepo2 call git pull Or let it run through a whole directory with git repositories FOR /D %G in (C:\Documents\GitRepos\*) Do cd %G & call git pull & cd ..

Is it possible to clone a local Git repo?

Your local git repo is entirely yours—it isn’t affected by other people’s code until they push their commits to the remote. Hopefully, you’re all using the same remote and everything syncs up, but the remote is just an endpoint. You could clone that endpoint and switch to a new remote without much issue.

How do I push code to two remote Git git branches?

Really, if you’re using a two remote setup, you’ll probably want a better way to manage pushing code to your second remote. The best way to handle this in git is to create another branch for code pushed to the second upstream, such as deployments to AWS CodeCommit.

How do I find the default remote of a git repository?

Whenever you clone a new repository, the default remote is set as “origin.” You can find the remotes for any given git repo by running: This will probably display the URL of your main repository on GitHub or whatever service you’re using. If you have multiple remotes, they’ll show up here, too.


1 Answers

You can make a .bat file in which you add all the repositories yourself with this

cd C:\path\to\git\repo call git pull cd C:\path\to\git\repo2 call git pull 

Or let it run through a whole directory with git repositories

FOR /D %G in (C:\Documents\GitRepos\*) Do cd %G & call git pull & cd .. 

Instead of .bat file there is a GUI client Github for windows

If you have all your repositories in there it won't be a pain to remember to sync them all.

like image 60
eikooc Avatar answered Oct 03 '22 04:10

eikooc