Skip to content

Commit

Permalink
Merge pull request #1829 from amcastro-tri/github_issue
Browse files Browse the repository at this point in the history
Documentation on how to avoid pushing directly to RobotLocomotion/drake
  • Loading branch information
RussTedrake committed Mar 8, 2016
2 parents 7902e72 + 8965ca9 commit 87f8d83
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions drake/doc/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Here are some useful links
code_style_guide
jenkins
known_issue
no_push_to_origin

Here are some tips for using our favorite IDEs for development with Drake

Expand Down
39 changes: 39 additions & 0 deletions drake/doc/no_push_to_origin.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
*****************************************
Avoid Accidental Pushes to the Repository
*****************************************

The Issue
=========

We want to prevent developers from accidentally pushing changes into RobotLocomotion/drake. This is accomplished by:

1. Everybody agreeing in a naming convention for the respositories.
2. Providing a dummy url for the repository we want to protect.


A Convention
============

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 Solution
==========
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

where ``no_push`` is the dummy url and ``upstream`` points to RobotLocomotion/drake (recall the convention is to call your fork ``origin``).

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.

0 comments on commit 87f8d83

Please sign in to comment.