Use of Git

From OpenSSLWiki
Revision as of 15:51, 25 April 2014 by Trawick (talk | contribs) (describe use of Git by OpenSSL committers and other contributors)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Use of Git with OpenSSL

The OpenSSL group hosts its own Git repository at openssl.org, and this contains the master copy of OpenSSL.

Contributors to OpenSSL should make use of the Github copy of this repository at https://github.com/openssl/openssl. Github makes it easy to maintain your own fork of OpenSSL for developing your contributions, as well as making a "pull request" to share fixes with the OpenSSL team when finished. Changes in the master Git repository are represented in the Github copy within minutes.

Getting a copy of the OpenSSL source tree

If you want to quickly make a copy of the OpenSSL source tree and you do not plan to publish any changes for use by others, just create a clone on your own machine.

$ git clone https://github.com/openssl/openssl.git

(Refer to Github documentation for instructions on other means of cloning the source tree.)

If you plan to make changes to the sources that you will share with others, including contributing changes to OpenSSL, it is recommended that you create a fork of the OpenSSL tree using your own Github id. You can use this to share changes with others whether or not you intend to submit changes to the OpenSSL team. Refer to the documentation at https://help.github.com/articles/fork-a-repo, in particular the discussion about how to track changes in the real OpenSSL repository that you forked.

Branches

The Git repositories contain multiple branches, representing development levels of OpenSSL as well as current and upcoming stable branches. An easy way to see the available branches is with the branch selector at https://github.com/openssl/openssl. The branches which are of most interest to most users are

  • master (development)
  • OpenSSL_1_0_2-stable (for the not-yet-released 1.0.2 series)
  • OpenSSL_1_0_1-stable
  • OpenSSL_1_0_0-stable

In order to access the code for a branch other than master, clone the Git repository then use the git checkout branchname command to switch to a different branch. Consider using separate checkouts for each branch you are working in, with appropriate names for each, such as in the following example.

$ git clone https://github.com/openssl/openssl.git OpenSSL-master
$ git clone https://github.com/openssl/openssl.git OpenSSL_1_0_2-stable
$ (cd OpenSSL_1_0_2-stable && git checkout OpenSSL_1_0_2-stable)
$ git clone https://github.com/openssl/openssl.git OpenSSL_1_0_1-stable
$ (cd OpenSSL_1_0_2-stable && git checkout OpenSSL_1_0_1-stable)

If you've created your own fork of OpenSSL, replace the URL on the git clone command with the one for your fork. Also, you'll need to follow the instructions at https://help.github.com/articles/fork-a-repo for picking up changes from the master repository that you forked.

Making patches

If you need to post a patch to the OpenSSL development mailing list for discussion, create the patch as follows:

(consolidate existing info about patch format, but in the form of a git diff invocation)

Making pull requests

After developing and testing changes to OpenSSL in your checkout (clone), push them to your fork of OpenSSL (git push), then use the Github interface to submit a pull request to the master OpenSSL repository for the particular revision(s).

(need to allude to other instructions about RT, right?)