Главная » Ошибки » git-repo from esrlabs – Coder Social

git-repo from esrlabs – Coder Social

В этой статье

git-repo’s Issues

repo don’t support refs/changes/… in XML


It seem that this repo not support refs/changes/… in XML, while it’s supported by Android.
Such construction is required when doing Jenkins continuous integration on patch submitted to gerrit.

Applying such patch fix (inspired from Android):

$ git diff
diff –git a/git_config.py b/git_config.py
index 8a9b46c..e45a265 100644
— a/git_config.py
+++ b/git_config.py
@@ -652,6 +652,10 @@ class Remote(object):
for spec in self.fetch:
if spec.SourceMatches(rev):
return spec.MapSource(rev)
+ if not rev.startswith(R_HEADS):
+ return rev
raise GitError(‘remote %s does not have %s’ % (self.name, rev))

def WritesTo(self, ref):
diff –git a/project.py b/project.py
index 5d9a4a6..a4b8cec 100644
— a/project.py
+++ b/project.py
@@ -1675,9 +1675,9 @@ class Project(object):
branch = self.revisionExpr
if is_sha1:
branch = self.upstream
– if branch.startswith(R_HEADS):
– branch = branch[len(R_HEADS):] – cmd.append((‘+refs/heads/%s:’ % branch) + remote.ToLocal(‘refs/head
+ if not branch.startswith(‘refs/’):
+ branch = R_HEADS + branch
+ cmd.append((‘+%s:’ % branch) + remote.ToLocal(branch))

ok = False
for _i in range(2):

Is it possible to integrate it in master branch ?

Thanks & Best regards,

fatal: Cannot get https://github.com/esrlabs/git-repo/clone.bundle (error 406)

Started seeing this on Dec 6 when running repo init:

fatal: Cannot get https://github.com/esrlabs/git-repo/clone.bundle
fatal: HTTP error 406

Any ideas?

Temp File Isnt Created When Pushing Multiple Repo’s

Traceback (most recent call last):
File “C:UsersAndrewDocumentsRyuusoftgit-repomain.py”, line 538, in
File “C:UsersAndrewDocumentsRyuusoftgit-repomain.py”, line 512, in _Main
result = repo._Run(argv) or 0
File “C:UsersAndrewDocumentsRyuusoftgit-repomain.py”, line 185, in _Run
result = cmd.Execute(copts, cargs)
File “C:UsersAndrewDocumentsRyuusoftgit-reposubcmdspush.py”, line 388, in Execute
self._MultipleBranches(opt, pending)
File “C:UsersAndrewDocumentsRyuusoftgit-reposubcmdspush.py”, line 182, in _MultipleBranches
script = Editor.EditString(“n”.join(script)).split(“n”)
File “C:UsersAndrewDocumentsRyuusoftgit-repoeditor.py”, line 99, in EditString
% (str(e), editor, path))
error.EditorError: editor failed, [Error 2] The system cannot find the file specified: vi c:usersandrewappdatalocaltemptmpd3bd97

repo status -o crashes

Alternative to using “more” for GIT_PAGER

In the readme.md documentation, the section about “I can not see any colors for repo status” mentions that overriding git-pager with “more” should solve the problem.

In my particular case, that did not work, because I don’t have a version of “more” available anywhere (other than in “C:WindowsSystem32”). So, when I set GIT_PAGER=more, I get the following error during “repo status”:

File “C:python_27_amd64fileslibsubprocess.py”, line 679, in __init__
errread, errwrite)
File “C:python_27_amd64fileslibsubprocess.py”, line 896, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified

I found out that an alternative to using a custom GIT_PAGER program is to set the LESS environment variable like this


This tells less to stop escaping ansi sequences, leaving them untouched, so that the console subsystem has a chance to process and interpret them.

My suggestion is to either

  • Update the FAQ section to mention this alternative
  • Or update “repo” to allow passing “-r” to less by default

exception when user.email and user.name not configured when repo init

Traceback (most recent call last):
File “/home/andreibechet/Projects/audicgw/.repo/repo/main.py”, line 532, in
result = _Main(sys.argv[1:])
File “/home/andreibechet/Projects/audicgw/.repo/repo/main.py”, line 505, in _Main
result = repo._Run() or 0
File “/home/andreibechet/Projects/audicgw/.repo/repo/main.py”, line 158, in _Run
result = cmd.Execute(copts, cargs)
File “/home/andreibechet/Projects/audicgw/.repo/repo/subcmds/init.py”, line 358, in Execute
File “/home/andreibechet/Projects/audicgw/.repo/repo/subcmds/init.py”, line 256, in _ConfigureUser
name = self._Prompt(‘Your Name’, mp.UserName)
File “/home/andreibechet/Projects/audicgw/.repo/repo/project.py”, line 623, in UserName
File “/home/andreibechet/Projects/audicgw/.repo/repo/project.py”, line 636, in _LoadUserIdentity
u = self.bare_git.var(‘GIT_COMMITTER_IDENT’)
File “/home/andreibechet/Projects/audicgw/.repo/repo/project.py”, line 2220, in runner
error.GitError: manifests var: b’n*** Please tell me who you are.nnRunnn git config –global user.email “[email protected]”n git config –global user.name “Your Name”nnto set your account’s default identity.nOmit –global to set the identity only in this repository.nnfatal: unable to auto-detect email address (got ‘[email protected](none)’)n’

fatal error on repo init

i did all steps u mention on main page
and when i run repo init -u https://github.com/……git -b …. i get :

fatal: cannot make ‘user dir here’ /.repoconfig-esrlabs directory: system couldn’t find directory

same for git clone then repo init

same with windows terminal or gitbash

fatal: Couldn’t find remote ref refs/heads/master

Full error:

fatal: Couldn’t find remote ref refs/heads/master
fatal: The remote end hung up unexpectedly�

I initialize a repository using:

repo init -u [email protected] :manifests/release.git -b release-2.9.0 -m c4_windows_master.xml

Sync using:

repo sync -d -c -q –jobs=8 –no-tags

Since I use Jenkins in my build environment, if I don’t wipe the workspace, the same commands as above are executed, however the ‘repo sync’ command throws the fatal error. This does not happen on linux using google’s repo tool (with or without jenkins, it was manifested in jenkins).

In examining the trace log on windows I find this:

: git fetch –quiet origin –no-tags +refs/heads/master:refs/remotes/origin/master 1>| 2>|�

Looking at the trace log on linux I see this:

: git fetch –quiet origin –no-tags +refs/heads/release-2.9.0:refs/remotes/origin/release-2.9.0 1>| 2>|

Contents of .repo/manifests/.git/config on windows looks like this:

[core] repositoryformatversion = 0
filemode = false
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[remote “origin”] url = [email protected] :manifests/release.git
fetch = +refs/heads/:refs/remotes/origin/
[branch “default”] remote = origin
merge = refs/heads/release-2.9.0�
Contents of .repo/manifests/.git/config on Linux looks like this:

[core] repositoryformatversion = 0
filemode = true
ignorecase = true
precomposeunicode = true
[remote “origin”] url = [email protected] :manifests/release.git
fetch = +refs/heads/:refs/remotes/origin/
[branch “default”] remote = origin
merge = refs/heads/release-2.9.0

If I run ‘git fetch –quiet origin –no-tags +refs/heads/master:refs/remotes/origin/master’ I see the fatal error thrown.

If I run ‘git fetch –quiet origin –no-tags +refs/heads/master:refs/remotes/origin/release-2.9.0’ no errors.

This version of repo seems to always run ‘git fetch –quiet origin –no-tags +refs/heads/master:refs/remotes/origin/master’ instead of the branch specified.

Let me know if you need more info. I think this is headed in the right direction! Thanks for providing a native windows tool!

the push command crash

Traceback (most recent call last):
File “/Users/baidu/Yohoo/.repo/repo/main.py”, line 538, in
File “/Users/baidu/Yohoo/.repo/repo/main.py”, line 512, in _Main
result = repo._Run(argv) or 0
File “/Users/baidu/Yohoo/.repo/repo/main.py”, line 185, in _Run
result = cmd.Execute(copts, cargs)
File “/Users/baidu/Yohoo/.repo/repo/subcmds/push.py”, line 381, in Execute
self.manifest.topdir, abort_if_user_denies=True)

Adding Windows support on upstream git-repo


I’m one of the maintainers of git-repo, and I was just made aware of this fork today.

We currently have a series of patches under review to add support for Windows.

Is this something that you would be interested in helping to review/test, potentially with the aim to contribute some of the work in this fork back upstream?


rmtree python failed when switching from a branch1 to Branch2

Hello ,

I am on the last stable branch of git-repo
I have python27
and i used GIT BASH 2.8.1

I have an issue on Windows

  1. repo init -b branch1
    “Manifest contains a module DocGeneration”
  2. repo sync
  3. repo init -b branch2
    “Manifest does not contain a module DocGeneration”
  4. repo sync

Deleting obsolete path C:/Project/SPC5_DEV/DEV/Tools/DocGeneration
Traceback (most recent call last):
File “C:projectgit-repomain.py”, line 538, in
File “C:projectgit-repomain.py”, line 512, in _Main
result = repo._Run(argv) or 0
File “C:projectgit-repomain.py”, line 185, in _Run
result = cmd.Execute(copts, cargs)
File “C:projectgit-reposubcmdssync.py”, line 753, in Execute
if self.UpdateProjectList():
File “C:projectgit-reposubcmdssync.py”, line 493, in UpdateProjectList
File “C:Python27libshutil.py”, line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File “C:Python27libshutil.py”, line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File “C:Python27libshutil.py”, line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
File “C:Python27libshutil.py”, line 252, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File “C:Python27libshutil.py”, line 250, in rmtree
WindowsError: [Error 5] Access is denied: ‘C:/Project/SPC5_DEV/DEV/Tools/DocGeneration.gitobjectspackpack-770eb7371be8e228d1bd76eda4a516c99289ba50.idx’

rmtree is KO

Best regards


Почему не отображается сайт, сделанный на react js, на github pages?

  • 1 подписчик
  • 18 часов назад
  • 76 просмотров


  • git
    • Git


  • Настройка лучшего сценария eslint с git pre-commit?

    • 1 подписчик
    • 13 окт.
    • 54 просмотра


  • git
    • Git


  • Clean up and optimize local repository

    Git has a commandgcbuilt-in to cleanup unnecessary files and optimize the local repository. The command do housekeeping tasks such as compressing file revisions to improve performance, removing unreachable objects which may have been created from prior invocations of git add, packing refs, pruning reflog, rerere metadata or stale working trees.

    Run the following command to optimize your current repository.

    git gc –prune=now

    If it didn’t work, you can remove .git/logs/refs/remotes/origin/branch and .git/refs/remotes/origin/branch then try again, as a few users reported that it works for them.

    Как удалить чужой репозиторий GitHub из списка?

    • 1 подписчик
    • 14 окт.
    • 65 просмотров


  • github
    • GitHub


  • What the error looks like

    “error: cannot lock ref” comes in many forms, often followed by addition information about what gone wrong. Below is a few of the outputs we’ve seen :

    C:MyWorkStuffProjectsRubyMyProject>git push origin master
    Unable to create branch path https://user:[email protected]/myproject/info/
    error: cannot lock existing info/refs
    fatal: git-http-push failed> git pull
    error: cannot lock ref ‘refs/tags/v2.8’: ‘refs/tags’ exists; cannot create ‘refs/tags/v2.8’
    From github.com:k3it/qsorder
    ! [new tag] v2.8 -> v2.8 (unable to update local ref)
    error: cannot lock ref ‘refs/tags/v2.9’: ‘refs/tags’ exists; cannot create ‘refs/tags/v2.9’
    ! [new tag] v2.9 -> v2.9 (unable to update local ref)error: cannot lock ref ‘refs/remotes/origin/test’: is at c21593dc62042d39efc044f366579667e but expected 3d0e5b15fc558cd447fb475a8ecd999> git pull origin master
    From github.com:Microsoft/vscode
    * branch master -> FETCH_HEAD
    error: cannot lock ref ‘refs/remotes/origin/master’: is at 2e4bfdb24fd137a1d2e87bd480f283cf7001f19a but expected 70ea06a46fd4b38bdba9ab1d64f3fee0f63806a5
    ! 70ea06a46f..2e4bfdb24f master -> origin/master (unable to update local ref)

    Now let’s go through possible solutions to make the “error: cannot lock ref” goes away.

    Почему GitHub не видит добавленные файлы в репозиторий?

    • 1 подписчик
    • 14 окт.
    • 74 просмотра


  • node.js
    • Node.js

    • +3 ещё


  • Сделал merge в локальный develop из branch-1, потом push на origin, а теперь получается что нужно откатить develop. Что делать?

    • 1 подписчик
    • 14 окт.
    • 50 просмотров


  • github
    • GitHub


  • Как добавлять изменения в репозиторий git с разных компьютеров?

    • 1 подписчик
    • 15 окт.
    • 84 просмотра


  • git
    • Git


  • Quick fix : Remove and re-add remote

    As all general computer-related advice said : When in doubt, restart! The quickest way you can get rid of “error: cannot lock ref” is to remove the remote so that you can add it again later.

    If you don’t know how to do that, follow step-by-step instructions below.

    1. Copy the SSH git URL of your existing remote. You can print it to the terminal using this command:

      git remote -v

    which will print out something like this:

    origin [email protected]:your-username/repo-name.git (fetch)
    origin [email protected]:your-username/repo-name.git (push)

    1. Remove the remote from your local git repo:

      git remote rm origin

    2. Add the remote back to your local repo:

      git remote add origin [email protected]:your-username/repo-name.git

    Как разделить файлы по веткам в новом проекте?

    • 1 подписчик
    • 18 окт.
    • 88 просмотров


  • git
    • Git


  • Почему возникает ошибка в Action?

    • 1 подписчик
    • 16 окт.
    • 42 просмотра


  • git
    • Git

    • +1 ещё


  • Есть ли разница как создавать ветку на основании feature или master?

    • 1 подписчик
    • 13 окт.
    • 66 просмотров


  • Показать ещёЗагружается…
  • Вакансии с Хабр Карьеры

    Frontend разработчик (автобизнес)


    от 140 000 ₽

    Технический писатель


    от 150 000 до 200 000 ₽

    ML инженер


    от 120 000 до 170 000 ₽
    Ещё вакансии

    Заказы с Хабр Фриланса

    Бэкенд приложения на Electron JS

    21 окт. 2022, в 12:39
    1000 руб./в час

    Нужно осуществить администрирование лок. сети и оборудования(удаленно)

    21 окт. 2022, в 12:33
    8000 руб./за проект

    Создать страницу «Работа администратора с предложениями экспертов»

    21 окт. 2022, в 11:59
    1000 руб./за проект
    Ещё заказы

    Минуточку внимания

    Присоединяйтесь к сообществу, чтобы узнавать новое и делиться знаниями


    Самое интересное за 24 часа

    • Почему из-за плагина w3tc не открывается страница?

      • 2 подписчика
      • 0 ответов
    • Smartctl ругается на нечитаемые сектора, но MegaCli делает вид, что всё в порядке, кому верить?

      • 2 подписчика
      • 0 ответов
    • Какая погрешность в количестве фиксаций целевых событий в Яндекс метрике допустима?

      • 2 подписчика
      • 0 ответов
    • Почему в Chrome не отображается круг, а получается квадрат?

      • 2 подписчика
      • 1 ответ
    • Как умножить матрицы с помощью SSE?

      • 3 подписчика
      • 0 ответов
    • Как сделать аутентификацию по номеру телефона?

      • 4 подписчика
      • 0 ответов
    • Как подождать асинхронного выполнения всех подписчиков события?

      • 3 подписчика
      • 0 ответов
    • Ломается весь код в Sublime Text?

      • 3 подписчика
      • 1 ответ
    • Периодически падает сайт с ошибкой 502 как найти проблему?

      • 3 подписчика
      • 2 ответа
    • Какой компилятор выбрать для C++?

      • 2 подписчика
      • 3 ответа
    • © Habr
    • О сервисе
    • Обратная связь
    • Блог

    Prune remote origin

    Users across online forums have reported that the command below worked for them:

    git remote prune origin

    The command will remove references to remote branches in the folder .git/refs/remotes/origin. So this will not affect your local branches and it will not change anything remote, but it will update the local references you have to remote branches. It seems in some cases these references can contain data Git cannot handle correctly.

    If you’re reluctant to try the command above, which I didn’t at first, you can run git remote prune origin –dry-run to see what happens before proceeding with the actual command.

    Как вывести в файл список всех игнорируемых через правила файла .gitignore папок/файлов?

    • 1 подписчик
    • 17 окт.
    • 43 просмотра


  • github
    • GitHub


  • Источники

    • https://coder.social/esrlabs/git-repo?type=discuss
    • https://qna.habr.com/q/189233
    • https://linuxpip.org/git-error-cannot-lock-ref/
    Решите Вашу проблему!