github-orga-sync
is a simple tool to synchronize all repositories from a GitHub organization.
The intended workflow is to deal with a GitHub Classroom "only" organization. New student repositories will be cloned or updated based on their master branch. A feedback can be pushed from a feedback branch afterwards.
⚠️ This software is quite new and untested! Don't rely on it. Here be dragons.
Install a current Go version.
git clone https://github.com/oxzi/github-orga-sync
cd github-orga-sync
go build
# Put the github-orga-sync binary into your $PATH
github-orga-sync
's workflow is very similar to that of git
itself.
At first, one initializes the main directory to contain all repositories.
Afterwards, one pulls all repositories.
After some changes, one pushes back those.
The last two steps will be repeated.
First, we create a new directory repos
.
The configuration file will be opened with our $EDITOR
.
$ github-orga-sync init repos
> INFO Directory is prepared directory=repos
$ cd repos
The internal git clone
will be used with the SSH URI.
To avoid having to enter the passphrase every time, it is recommended to set up ssh-agent
.
$ github-orga-sync pull
> INFO Fetching repositories from GitHub.. branch=master organization=my-github-orga
> INFO There are 3 repositories in total
> INFO Created new repository repository=ubung-01-testteam
> INFO Created new repository repository=ubung-01-team23
> INFO Created new repository repository=ubung-01-team42
> INFO Finished pull successfully created=3 updated=0
We make some changes in our branch.push
branch (defaults to feedback
).
Afterwards, we push them back.
For this example, we only alter one repository, ubung-01-testteam
.
$ github-orga-sync push
> INFO Fetching repositories from GitHub.. branch=master organization=my-github-orga
> INFO There are 3 repositories in total
> INFO Pushed updates to remote repository=ubung-01-testteam
> WARN Local repository does not contain branch branch=feedback repository=ubung-01-team23
> WARN Local repository does not contain branch branch=feedback repository=ubung-01-team42
> INFO Finished push successfully updated=1
GNU GPLv3 or later.