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

If you've already worked through the Getting started as 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.

commit1.png

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.

commit2.png

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 ....

Push1.png

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.

Push2.png

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.

PR2.png

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.

Fetch1.png

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.

Fetch2.png

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.

Merge1.png

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 ....

Push3.png

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.

Push4.png

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