esrlabs / git-repo

repo - The multiple repository tool (also works on MS Windows!)
https://code.google.com/p/git-repo/
Apache License 2.0
436 stars 145 forks source link

Repo for Microsoft Windows and Linux

This is E.S.R.Labs Repo - just like Google Repo but this one also runs under Microsoft Windows. For more information, see Version Control with Repo and Git.

Repo is a repository management tool that Google built on top of Git. Repo unifies many Git repositories when necessary, does the uploads to a revision control system, and automates parts of the development workflow. Repo is not meant to replace Git, only to make it easier to work with Git in the context of multiple repositories. The repo command is an executable Python script that you can put anywhere in your path. In working with the source files, you will use Repo for across-network operations. For example, with a single Repo command you can download files from multiple repositories into your local working directory.

Setup steps for Microsoft Windows

Fix priviledges to allow for creation of symbolic links
Download and install Git
Download and install Python
Download and install Repo either using the Windows Command Shell or Git Bash
Windows Command Shell
md %USERPROFILE%\bin
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > %USERPROFILE%/bin/repo
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo.cmd > %USERPROFILE%/bin/repo.cmd
Windows PowerShell
md $env:USERPROFILE\bin
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > $env:USERPROFILE/bin/repo
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo.cmd > $env:USERPROFILE/bin/repo.cmd
Git Bash
mkdir ~/bin
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > ~/bin/repo
curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo.cmd > ~/bin/repo.cmd

Setup steps for Linux

Downloading and installing Git and Python
sudo apt-get install git-core
sudo apt-get install python
Download and install Repo
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://raw.githubusercontent.com/esrlabs/git-repo/stable/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Usage

For more detailed instructions regarding git-repo usage, please visit git-repo.

FAQ Troubleshooting

I can not see any colors for repo status

The pager which is used for repo status is set per default to less, which unless otherwise configured will ignore escape sequences. You can set the environment variable LESS to -FRSX to make less handle colors. (You might also want to set LESSCHARSET to utf-8)

It still doesn't work!

You can try using more as your pager of choice. It doesn't behave exactly the same as less but it might be enough for you.

git config --global core.pager more

. Alternativly, the environment variable GIT_PAGER can be set to more.

I get a WindowsError when initializing my repo with repo init .. in Windows Command Shell

If there is a warning at the beginning of the output which reads states that GPG is not available

warning: gpg (GnuPG) is not available.
warning: Installing it is strongly encouraged.

you have to add gpg.exe to your PATH variable. The executable can be found in your Git installation folder $GIT\usr\bin. When you are using Git Bash, the $Git\usr\bin folder is already added to your PATH.

Changes to original git-repo

Portable changes
New Features

Developer Information

Resyncing with official google repo

For resyncing with the official google repo git, here are the commands for resyncing with the tag v1.12.33 of the official google repo:

# add google git-repo remote with tag
git remote add googlesource https://android.googlesource.com/tools/repo/
git checkout v1.12.33 -b google-latest

# checkout basis for resync
git checkout google-git-repo-base -b update
git merge --allow-unrelated-histories -Xtheirs --squash google-latest
git commit -m "Update: google git-repo v1.12.33"
git rebase stable

# solve conflicts; keep portability in mind

git checkout stable
git rebase update

# cleanup
git branch -D update
git branch -D google-latest
Creating a new signed version

Commands for creating a new version of repo:

git tag -s -u KEYID v0.4.16 -m "COMMENT"
git push origin stable:stable
git push origin v0.4.16