This git repository aggregates other Marakana Android-related git repositories using Google’s repo tool and the manifest file.
Specifically, this tool clones Marakana Android courseware repo as well as various Android code project repos into the following directories:
-
courseware/
-
code → ../code/
-
device → ../device/
-
-
code/
-
device/
Warning
|
https://github.com/marakana/courseware-android is a private repo. |
-
Install the repo tool:
$ mkdir -p ~/bin
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod +x ~/bin/repo
-
Set up a working directory (e.g. android/):
$ mkdir -p android
-
Change to this directory:
cd android
-
Initialize repo:
$ repo init -u git@github.com:marakana/android-repo.git
-
Pull the files:
$ repo sync
-
Switch all projects to the master branch:
$ repo start master --all
-
Sync first
$ repo sync
-
Switch any newly added projects to the master branch:
$ repo start master --all
To commit and push local changes upstream, change into the nested git repository where you’ve made changes (e.g. to courseware/) and use normal git commands:
-
Change to the project’s directory:
$ cd /path/to/android/courseware
-
Stage the changed file:
$ git add new-or-modified-file.asc
-
Commit:
$ git commit -m "some change"
-
Push:
$ git push
To add a new project to repo, do the following:
-
Get to the manifest directory:
$ cd .repo/manifests/
-
Make sure that you are on the master branch:
$ git checkout -b master
-
Register your project (e.g. a demo app) as a new entry in the default.xml manifest file:
<project path="code/MyDemo" name="MyDemo" />
NoteThe path attribute of <project .../> refers to the local directory name for our project where as the name attribute refers to the remote git repository name (relative to the parent of this repository). TipSee manifest-format.txt for more info on the syntax of this manifest file. -
Commit your changes
$ git commit -m "Added a new project (MyDemo)" default.xml
-
Push your changes upstream
$ git push
-
Test by syncing your main repo tree:
$ cd -
$ repo sync