Skip to content
Thorben Groos edited this page Dec 23, 2017 · 8 revisions

If you've already worked through the Getting started as a JCrypTool Developer tutorial you have the four JCrypTool-Git repositories, core, crypto, tests and doc on your PC, in your local git repository. Now the question arises, how do I get my changes back to the JCrypTool repository on GitHub. The two main steps for this, committing and pushing, are explained here.

In this tutorial the graphical user interface (GUI) of built-in git client in Eclipse RCP is used.

How do I commit my changes?

Committing using the GUI of the built-in git client in Eclipse RCP is quite simple. Right-click on a plugin, folder or class, then select Team -> commit.

Right click on the crypto repository

You will see three fields, Unstaged Changes, Staged Changes and Commit Message. In Unstaged Changes, you see all the files you've changed. To commit files, drag and drop them into the Staged Changes field. Then enter a comment in Commit Message on what you have changed. Commit your changes by pressing commit.

Screenshot of the Git Staging view in Eclipse RCP

Note: Your changes are not yet on your fork or in the JCrypTool repository. See the next chapter to learn how to push the committed changes onto your fork.

How do I push my changes to my fork?

You can push your committed changes to your fork by right-clicking on the repository in the Eclipse repository explorer. Then you choose Remote ... -> Push ....

Right click on the crypto repository

A dialog will open in which you must select the destination repository. There you select your fork and click on Next. On the next page you decide which local branch should be pushed into which branch on your fork. Select the appropriate branches in the group "Add create / update specification" and press Add Spec. By clicking on Finish all committed changes will be pushed onto your fork.

Screenshot of the Push Ref Specifications dialog

How do I create a pull request?

You can create a Pull Request (PR) by pressing New Pull Request on the main page of your Fork in GitHub. As base fork, for instance jcryptool/crypto should be selected, as base branch there develop. As head fork select your fork of the the jcryptool repository, as compare select the branch you made your changes in.

Screenshot of the GitGub.com website

Give your Pull Request a title and enter a description, so that others can recognize the changes.

For more information see: https://help.github.com/articles/creating-a-pull-request/

How do I keep my local repository and my GitHub fork up to date?

Keeping your GitHub fork up to date requires two basic steps. First, you need to bring your local repository up to date. Then you must push the changes onto your GitHub fork.

To bring your local repository to the current state of the jcryptool/crypto repository, right-click on the crypto repository in the git repository explorer. Then press Remote ... -> Fetch ... and select the jcryptool/crypto repository.

Right click on the crypto repository

The default settings for the Fetch Ref Specifications can be left that way. With a click on Finish the changes made in jcryptool/crypto are downloaded to your PC.

Screenshot of the Fetch Ref Specifications dialog

To merge the downloaded changes into your current branch, right-click on the crypto repository, press Merge ... -> select the jcryptool/crypto develop branch (in the Remote Tracking category) and press Merge.

Screenshot of the Merge dialog

Your local repository is now on the same status as the jcryptool/crypto repository.

To bring your GitHub fork up to date, push your clone to your fork. You do this by right-clicking on the crypto repository in git repository explorer -> Remote ... -> Push ....

Right click on the crypto repository

In the appearing dialog select your fork -> click on Next. As source-ref, select the branch you want to push. As Destination-ref, select the branch you want to push into. Press Add Spec, then Finish.

Screenshot of the Push Ref Specifaction dialog by updating the fork

Your current branch will now be uploaded to your fork. Your fork is now even with jcryptool/crypto.