Git learning (two): first acquaintance with the git-rev-parse command

  • git rev-parse --git-dir //Display the location of the repository.git command

Excuting an order git rev-parse --git-dir
Insert picture description here

  • git rev-parse --show-toplevel //Display the root directory of the workspace

Excuting an order git rev-parse --show-toplevel
Insert picture description here

  • git rev-parse --show-prefix //Display the relative path relative to the root directory of the workspace

Excuting an order git rev-parse --show-prefix
Insert picture description here

  • git rev-parse --show-cdup //Display the depth from the current directory (cd) back (up) to the root directory of the workspace

Excuting an order git rev-parse --show-cdup
Insert picture description here

  • git rev-parse --local-env-vars //Display the local library of the git environment variable list, only the names of the variables are listed, not their values

Excuting an ordergit rev-parse --local-env-vars
Insert picture description here

  • git rev-parse --git-dir //Display the value of the GIT_DIR variable

Excuting an ordergit rev-parse --git-dir
Insert picture description here

  • git rev-parse --symbolic --branches //Display branches

Excuting an order git rev-parse --symbolic --branches
Insert picture description here

  • git rev-parse --symbolic --tags //Display milestones

Excuting an order git rev-parse --symbolic --tags
Insert picture description here

  • git rev-parse HEAD //Display the SHA1 value submitted by HEAD

Excuting an ordergit rev-parse HEAD
Insert picture description here

  • git rev-parse --help //Open the help document

Excuting an ordergit rev-parse --help

Guess you like

Origin blog.csdn.net/houxiaoni01/article/details/103566878