Last active
February 2, 2016 16:26
-
-
Save scottsb/a0d55e49ca9d3e8c73c2 to your computer and use it in GitHub Desktop.
Run Git as Repo Owner
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
#!/bin/sh | |
# Execute git commands passed on command line as whatever user owns the current Git repository. | |
# Script can be substituted 1:1 for git in commands. | |
# Available under the MIT license. | |
sudo -u $(stat -c %U $(git rev-parse --git-dir)) git "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compressed into one very easy to read line!