Avoid Accidental Pushes to the Repository¶
We want to prevent developers from accidentally pushing changes into RobotLocomotion/drake. This is accomplished by:
- Everybody agreeing in a naming convention for the respositories.
- Providing a dummy url for the repository we want to protect.
To make the notion of
origin consistent with the idea of the one repository you work with, we agree in the following convention:
"upstream" = RobotLocomotion/drake "origin" = my fork
so that a simple
git push will push changes into a developer’s fork. This still does not prevent you from pushing into
upstream. To protect developers from making this simple mistake the following solution is proposed.
A way to avoid pushing into a repository is providing a dummy url address to the repository. This is accomplished by issuing the git command:
git remote set-url --push upstream no_push
no_push is the dummy url and
upstream points to RobotLocomotion/drake (recall the convention is to call your fork
If a push to the master repository is attempted issuing a
git push upstream my_branch, git will return the following error message:
fatal: 'no_push' 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.