23

I installed git for windows and it works fine(e.g. use one of the following solutions Want to download a Git repository, what do I need (windows machine)?).

I tried to use repo of google but it needs gpg and python 2.7. I installed both and it works fine the only problem is that repo script use some unix oriented features such as symbolic links and fcntl. Is there any alternative code of repo for windows?

I couldn't found some native solution by google. if there is one I'll try to push it into google repo git repository or try to use it as is.

Community
  • 1
  • 1
0x90
  • 39,472
  • 36
  • 165
  • 245
  • 1
    FYI, if you're trying to build Android in Windows, [it's not supported](http://source.android.com/source/initializing.html). – Wesley Wiser Jan 08 '13 at 20:26
  • 10
    Why this question is regarded off-topic ? This growing complexity of regulations really defeat the purpose of stackoverflow. – Ahmed May 08 '18 at 09:40

5 Answers5

11

Yes, Google repo script can be compliant with Windows. Follow the steps below.

But before, as Borealid said repo as not been ported on Windows. repo (forall.py) uses fcntl that is not available on Windows (Unix only).

However there is Cygwin and its own python and git tools.

If git version from MSysGit project for you or if you love your git GUI that is based on MSysGit only, then follow the following steps. These steps ensure that Cygwin can create native NTFS symlinks. Else if the git from Cygwin is sufficient, you do not have to do it. But it is better as setting CYGWIN=winsymlinks:native tells Cygwin to use native NTFS symlinks instead of old Cygwin workaround.

  1. Use Windows Vista or later (or switch to Linux)
  2. Have Admin privileges
  3. Dowload and install Cygwin (32 or 64 bits)
  4. Select and install python and git (and gpg if you want) from Cygwin installer
  5. Set CYGWIN=winsymlinks:native in your Cygwin shell:

    export CYGWIN=winsymlinks:native
    mkdir NEW_DIR
    cd    NEW_DIR
    repo init -u YOUR_URL
    repo sync -j 7
    

(see also my other post)

Community
  • 1
  • 1
oHo
  • 51,447
  • 27
  • 165
  • 200
  • I've had partial success using this approach, however I am still getting seemingly random `0 [main] git-remote-https 69956 child_info_fork::abort: C:\cygwin\bin\cygldap-2-4-2.dll: Loaded to different address: parent(0x3A0000) != child(0x370000) error: cannot fork() for fetch-pack: Resource temporarily unavailable` errors. – friederbluemle Nov 05 '13 at 05:57
  • Hi @friederbluemle. I do not understand when your error occurs. Please post a new question where you can give more details. I will be pleased to help you. After posting your question, just add a new comment here. Then I will take time to reproduce your case. And maybe someone else will find the trick... Cheers ;) – oHo Nov 05 '13 at 12:57
  • 1
    @olibre you are my hiro :D - fast way to use repo on windows :) – ceph3us Jan 24 '16 at 07:24
10

A working repo tool for windows is available here: https://github.com/esrlabs/git-repo

It requires Python 3+ and git 1.7.2+

Btw, the original forked repo version seems pretty old, so it might not contain all current functionalities.

Asimov81
  • 101
  • 1
  • 3
  • The readme for the project states that Python 3+ is experimental only: `Note: Python 3.x is supported on an experimental bases by git-repo ` – skelliam Mar 07 '18 at 19:12
8

There is an alternative for whoever has a choice to work with an alternative to repo, it's called gclient.

See Google's depot tools:

gclient: Meta-checkout tool managing both subversion and git checkouts. It is similar to repo tool except that it works on Linux, OS X, and Windows and supports both svn and git. On the other hand, gclient doesn't integrate any code review functionality.

0x90
  • 39,472
  • 36
  • 165
  • 245
4

There is no native repo for Windows currently.

You may use a Linux virtual machine or dual-boot, or work around the (relatively minor) issues caused by symlinks not functioning on your filesystem.

Another option would be to just use git directly instead of using the repo as a convenience wrapper - repo is a support tool, and doesn't add any substantial power.

Borealid
  • 95,191
  • 9
  • 106
  • 122
0

git-repo created by Alibaba works on Linux, Mac and Windows. You may try it.

I'm SuperMan
  • 653
  • 7
  • 20