InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Git tutorials

  • Github for beginners
  • Undo last commit
  • List git branches
  • Git checkout remote branch
  • Diff two branches
  • Show log of one user's commits
  • View diff for a given commit id
  • Setup password less git push for github
  • Git - Check if a hash is valid
  • Git - display specific length commit hash
  • Git - rename local branch
  • Git create branch
  • Git delete branch
  • Git detached head
  • Git display info of last commit (HEAD) in one line
  • Git display local HEAD location
  • Git log with file names
  • Git show details of a commit hash
 
  • Home
  • > Tutorials
  • > Git

Git – Check if a hash is valid

on Mar 5, 2017

Use git show and check for exit status

$ git show -s 97d79ecf6b6
commit 97d79ecf6b6c5cc3c1485eb3c46e12986a978f57
Author: Dave Methvin 
Date:   Mon Nov 9 17:49:01 2015 -0500

    Dimensions: Empty sets should return undefined
    
    Ref gh-2319
    Closes gh-2701
echo $?
0

Use git cat-file and check for exit status

$ git cat-file commit 97d79ecf6
$ echo $?
0

Suggested posts:

  1. Git log with file names
  2. Svn – how to make file executable on Linux
  3. Command line – top IP list from apache access log
  4. Bash – pass all arguments from one script to another
  5. Git show details of a commit hash
  6. AngularJS format date using date filter
  7. Ubuntu – how to find boot autostart status of a service
  8. CSS – round toggle switch using checkbox and label
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Git, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress