How to know if a tag is a fast foward to another in a BARE repository?

We want to make a build validation, we want to make sure the new version has all commits from the previous one. We are tagging each new version.

We are using: git merge nextversiontag –no-commit –ff-only, but this command works only on a full repository. Team City 8 clones a bare repository.

  • TeamCity fails to trigger on wildcard-specified branch
  • How to get Team City to only trigger a build on a Github pull request if it contains changes in a specific folder
  • Team City execute Git script
  • Remove inactive branches from IIS via TeamCity
  • How to get git like statistics from TFS
  • How to set a Mercurial VCS build trigger for TeamCity that ignores label operations
  • Teamcity Agent cannot Run the Build
  • How does one create a branch in TeamCity for multiple VCS configurations?
  • One Solution collect form web for “How to know if a tag is a fast foward to another in a BARE repository?”

    If all you want to know is whether you can fast-forward from one tag to another, then that’s just simply asking the question: “Is the old tag reachable from the new tag by following parent-references along the commit graph?”

    You can answer that question by using the following:

    git merge-base --is-ancestor <old-tag> <new-tag>; echo $?
    

    If the output is 0, then the old tag is reachable from the new tag, and if it’s 1, then it’s not. $? is Bash syntax for the error code of the last command.

    If you were planning on doing something else for your build validation, then you’ll need to update your question to clarify what it is that you were planning to do.

    Git Baby is a git and github fan, let's start git clone.