Git checkout: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 17: Line 17:
  git checkout RESTEASY_JAXRS_2_3_2_FINAL
  git checkout RESTEASY_JAXRS_2_3_2_FINAL


To reposition the local repository on the head of the master branch:
==Reposition the local repository on the HEAD of a branch==
 
git checkout <''branch-name''>


  git checkout master
  git checkout master
==Convert a Detached HEAD into a Named Branch==
While being in a detached HEAD situation:
git checkout -b <''name-of-a-new-branch''>

Revision as of 17:21, 18 December 2017

Internal

Overview

Check Out the HEAD of a Branch

git checkout <branch-name>

Checkout a Tag into a Detached HEAD

The following command checks out a specific tag - technically the commit that corresponds to the given tag - into a detached HEAD branch.

git checkout <tag-name|commit-id>
git checkout RESTEASY_JAXRS_2_3_2_FINAL

Reposition the local repository on the HEAD of a branch

git checkout <branch-name>
git checkout master

Convert a Detached HEAD into a Named Branch

While being in a detached HEAD situation:

git checkout -b <name-of-a-new-branch>