Using repo on OSX

Walden systems, Ames, Ames Computers,  walden, systems, geeks corner, geeks, OSX, brew, github, git, repository, repo, curl, version control, vcs, Lineage, Lineage OS

Repo is a tool built on top of Git. Repo helps manage many Git repositories, does the uploads to revision control systems, and automates parts of the development workflow. Git is one of the most popular tools used for distributed version control system. Git is commonly used for source code management and has become more used than old version control systems like Subversion. Repo is not meant to replace Git, only to make it easier to work with Git. The repo command is an executable Python script that you can put anywhere in your path.

Installation

In Ubuntu, installing git is a simple matter of running OS and package updates using the apt-get update command and then installing using the apt-get install git-core command. On the Mac, we have a few more steps. The first thing we need to do is open the terminal app. We can open the terminal app by pressing the Command and Space keys, typing Terminal and then hitting the enter key. Once the terminal app is up, type in the following in the terminal window:

    $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 
        < /dev/null 2> /dev/null


If the screen asks for a password, enter your Mac's user password and continue. When you type the password, it won't be displayed on screen, but the system would accept it. So just type your password and press ENTER/RETURN key. Then wait for the command to finish. This will take several minutes. Once the command is finished, we can install repo by typing in the following command, brew install repo.

Using Repo

Once repo is installed on the Mac, we can use the git repository the same as we would in Linux. In this example, we will go through getting the LineageOS repo from git hub. There are three steps involved. The first step is to initialize our local repo. Next, we get the manifest file that contains the file structure and all the file names. Finally, we need to synchronize the repository. Syncronizing the repository may take several minutes to several hours to download.

   $ repo init -u git://github.com/LineageOS/android.git -b lineage-15.1
   $  curl --create-dirs -L -o .repo/local_manifests/manifest_brcm_rpi3.xml 
      -O -L https://raw.githubusercontent.com/lineage-rpi 
      android_local_manifest/lineage-15.1/manifest_brcm_rpi3.xml
   $ repo sync

Once the local repository is synced with GitHub, we can start editing the files. Once we are done, we can upload to the repository by syncing the repo again.