How do i check the references available in a local git repository?



  • Man page for git-show-ref.

    Shows heads, remote, and tag references and their commit hash

    $ git show-ref
    

    Output;

    365cfd054e543efe399eae8a319fd92ec30ae35b refs/heads/master
    365cfd054e543efe399eae8a319fd92ec30ae35b refs/remotes/origin/HEAD
    38b680861806e5a956e097e2aa92ddb70c733d37 refs/remotes/origin/attempted-generic-queue-api
    b6802c5834df3cc1e85ff7d0a79f4063a49d047d refs/remotes/origin/backward-compatible-amqqueue
    ...
    ...
    ...
    564876de92a4074b733f004fb9b2330f91d78e2c refs/tags/6547461e6c2e
    341f95b735b5b47964fe3644b9229e7079357c98 refs/tags/Aman-06-09-08
    78c13f5a5e1d70370b980a27fbd59d3b36a477d5 refs/tags/Aman-06-09-08_2
    6b7ece6cc89aa35f99d6bd3c078114a7a8a2daa1 refs/tags/nightly
    09302bfc429f06181ba97cdf3f0eda89cd06ec10 refs/tags/rabbitmq_v1_4_0
    c00f44b52027b358996192e05fa507cc4bf404b7 refs/tags/rabbitmq_v1_5_0
    ...
    ...
    ...
    

    For testing is can be used to see if a reference exists and if used with scripting there is a quiet option.

          -q, --quiet
               Do not print any results to stdout. When combined with --verify this can be used to silently
               check if a reference exists.
    

    Rather than going into the .git directory, it is recommended to use git show-ref


Log in to reply
 

© Lightnetics 2024