Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Git checkout branch from tag: got different code from that in github

Git checkout branch from tag: got different code from that in github.

git clone https://github.com/eclipse-ee4j/mojarra
git checkout -b mybranch 2.3.18.RELEASE

pom.xml:

<groupId>org.glassfish</groupId>
<artifactId>mojarra-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

pom.xml file is different from the pom.xml file on github.com tag 2.3.18.RELEASE.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<groupId>org.glassfish</groupId>
<artifactId>mojarra-parent</artifactId>
<version>2.3.18</version>
<packaging>pom</packaging>

>Solution :

This question seems to boil down to a typo. There is no tag 2.3.18.RELEASE – it’s called 2.3.18-RELEASE (note the hypen before the RELEASE).

When you try to checkout 2.3.18.RELEASE, it will fail:

mureinik@computer ~/src/git/mojarra (master)
$ git checkout -b mybranch 2.3.18.RELEASE
fatal: '2.3.18.RELEASE' is not a commit and a branch 'mybranch' cannot be created from it

Since the checkout operation failed, you’ll remain on the branch you were when you attempted the command (in the sequence described in the question, this will be master, the default branch after cloning the repo).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading