Created
October 8, 2020 14:33
-
-
Save werner/1a7dd8773d9731f172fc4732a6682bd9 to your computer and use it in GitHub Desktop.
Figure it out if the branch I'm working on is updated to master remote
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local_commit = `git rev-parse HEAD` | |
raw_remote_commit = `git ls-remote --heads --quiet` | |
remote_commit = raw_remote_commit.split(/\s/)[0].strip | |
search_in_commits = `git log | grep #{remote_commit}` | |
puts 'Branch not merged with master' if search_in_commits == '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment