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.

  • Can't push to new gitlab install
  • Git clone SSH - fatal protocol error
  • Branch a public git repository, on a private git server
  • how to config git repo so that all files are stored with line-ending LF ( not CFLF ) ?
  • Logout and login as another user git bash
  • .gitignore exclusion is not working for a single file
  • Visual SVN diff and compare tools for Linux
  • What is the difference between the working directory and the git Index?
  • NetBeans not showing GIT in the right-click menu
  • How to re-work on the forked GitHub repository after merge?
  • git add remote branch
  • Git, how to keep files with git rm --cached even after pull on other machines
  • 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.