Created
January 7, 2014 03:29
-
-
Save omega/8294263 to your computer and use it in GitHub Desktop.
Make it harder to push to a 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
# Add a new remote, called safe | |
$ git remote add -f safe `git remote -v | grep origin | grep push | awk '{ print $2 }'` | |
# Set the push url of this remote to nowhere | |
$ git remote set-url --push safe nowhere | |
# Set the upstream branch for our branch to safe origin | |
$ git branch --set-upstream-to=safe/master | |
# lets try a push | |
$ git push | |
fatal: 'nowhere' does not appear to be a git repository | |
fatal: Could not read from remote repository. | |
Please make sure you have the correct access rights | |
and the repository exists. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment