Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

repo tool unable to pull based on tags

Tags:

git

repo

Im using repo tool to manage multiple repositories.

Here is my sample manifest file and I have given a tag name in my revision - 'firsttag'.

When I do a repo sync it says -

Fetching project repo1
fatal: Couldn't find remote ref refs/heads/firsttag
<?xml version="1.0" encoding="UTF-8"?>

xml file

  <!-- <default revision="refs/heads/master" -->
  <default revision='firsttag'
           remote="github"
           sync-j="4" />

  <project name="repo1" remote="github" path="repo1"/>
  <project name="repo2" remote="github" path="repo2"/>

</manifest>
like image 510
user1050619 Avatar asked Mar 09 '23 11:03

user1050619


1 Answers

revision="firsttag" or revision="refs/heads/firsttag" means a branch. For a tag, it should be revision="refs/tags/firsttag".

If you are using Gerrit, you'll see a ref like refs/changes/33/44433/1. If you'd like to use this ref, it should be revision="refs/changes/33/44433/1".

For a specific project, you could use both revision and upstream if you know the commit. It's very useful when you'd like an old commit of a branch. Note that revision in a project overrides the one in default.

<project name="repo1" remote="github" path="repo1"
         revision="3b9211fe8c87bf424c2bf128b1dec572375b318f"
         upstream="somebranch"/>

This is the output of repo manifest -r. The upstream can be a tag or any ref.

It's okay to use revision only if the value is a ref name.

<project name="repo1" remote="github" path="repo1"
         revision="refs/tags/secondtag"/>
like image 90
ElpieKay Avatar answered Mar 19 '23 09:03

ElpieKay