git pullf
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
#!/usr/bin/env ruby | |
# git pullf | |
# --------- | |
# Force pull without needing to be verbose | |
current = `git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD)` | |
remote, remote_branch = current.strip.split("/", 2) | |
branch = `git branch | grep \\* | cut -d ' ' -f2` | |
command = "git pull --force #{remote} #{remote_branch}:#{branch}" | |
puts command | |
exec command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment