What does it do?
It gets all configured git repositories and checks out every branch and then checks out the default branch.
Variables used are defined within
These variables tell
getrepos all information required to download a list of repositories.
||variable||This is the location of the base git repository.|
||array||A listing of all repositories to download.|
||variable||The git repository extension.|
How it all works.
getrepos goes through each repository within
git_repo_list and performs the following actions in this order:
- Checks if the repository exists. The following actions are only performed on new repositories.
- Clones the repository.
- Gathers information on the default branch.
- Queries the server for all remote branches.
- Strips information from the branch names. eg. origin/
- Checks out each branch to make sure you have local versions. (I do this so IDE's like atom can see the branches correctly.)
- Checks out the default branch to make sure you are in the branch you would have normally been in after a clone.
What it does not do.
It doesnt update the branches if you are not cloning the branch fresh.
The only dependency
getrepos has is
git. It uses git to clone, find out the branches and check them out.
install script uses
rsync in order to put the files in the appropriate places.
rsync -rvp to copy the scripts and configs to the correct place.