Skip to content

Instantly share code, notes, and snippets.

@kawakami-o3
Created November 26, 2018 17:36
Show Gist options
  • Save kawakami-o3/b7098989a8afa8b06ae27a5c44eac642 to your computer and use it in GitHub Desktop.
Save kawakami-o3/b7098989a8afa8b06ae27a5c44eac642 to your computer and use it in GitHub Desktop.
checkout next commit
#!/bin/sh
current=`git log --oneline | wc | awk '{print $1}'`
sha1=`git log master --oneline | tail -$((current+1)) | head -1 | awk '{print $1}'`
git checkout $sha1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment