Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added info about running checkstyle and findbugs verification

...

Code Block
git clone https://github.com/pveentjer/hazelcast.git

 


Make sure you replace the URL by the one in your clipboard and press enter. Now Github will checkout your origin repository:

Code Block
Cloning into 'hazelcast'...
remote: Counting objects: 128756, done.
remote: Compressing objects: 100% (41180/41180), done.
remote: Total 128756 (delta 64545), reused 128740 (delta 64530)
Receiving objects: 100% (128756/128756), 28.32 MiB | 1.20 MiB/s, done.
Resolving deltas: 100% (64545/64545), done.

...


Once that is finished, change directory to hazelcast.

Code Block
cd hazelcast

 


The next step is to register the real Hazelcast repository under the name master by typing the below commands:

Code Block
git remote add upstream https://github.com/hazelcast/hazelcast.git
git fetch upstream

 


You will see the output similar to the following:

Code Block
From https://github.com/hazelcast/hazelcast
 * [new branch] maintenance-2.x -> upstream/maintenance-2.x
 * [new branch] maintenance-3.x -> upstream/maintenance-3.x
 * [new branch] master -> upstream/master
 * [new tag] v2.6.1 -> v2.6.1
 * [new tag] v2.6.2 -> v2.6.2
 * [new tag] v2.6.3 -> v2.6.3
 * [new tag] v2.6.4 -> v2.6.4
 * [new tag] v3.0 -> v3.0
 * [new tag] v3.0-RC1 -> v3.0-RC1
 * [new tag] v3.0.1 -> v3.0.1
 * [new tag] v3.0.2 -> v3.0.2
 * [new tag] v3.0.3 -> v3.0.3
 * [new tag] v3.1 -> v3.1
 * [new tag] v3.1.1 -> v3.1.1
 * [new tag] v3.1.2 -> v3.1.2
From https://github.com/hazelcast/hazelcast
 * [new tag] v2.6.5 -> v2.6.5
 * [new tag] v2.6.6 -> v2.6.6
 * [new tag] v3.1.3 -> v3.1.3
 * [new tag] v3.1.4 -> v3.1.4
 * [new tag] v3.1.5 -> v3.1.5

...


To see which branches there are in total, you can use the below command:

Code Block
git branch -a

...


Now you have a fully working git setup.

...

Below flow is the main development cycle of Hazelcast:

 

 

 

 

 

 

 

 

 

 











Adding a New Feature To master Branch

...

Code Block
# check out the master branch if you want to add a feature based on the master branch
git checkout master
# gets the latest changes from the upstream repo to make sure we are fully up to date
git pull upstream master
#create a new branch for the new feature
git checkout -b fix/3.x/myfeature
..make your changes
# adds all our changes to changeset
git add -A
# commit all the changes: they will now be available on our local repo
git commit -m "My changes"
# push our feature to our personal repo
git push -u origin fix/3.x/myfeature

...


If you think that your feature/fix is complete, you can go to your Github page and create a pull request. 

...

Code Block
# checks out your branch
git checkout yourbranch

...


Make changes and then:

Code Block
git add -A
git commit -m "More changes"
git push -u origin yourbranch

...

Code Block
git stash save "uncommitted changes"
git fetch origin --prune
git checkout -b maintenance-3.x origin/maintenance-3.x
git stash pop stash@{0}

...


3. Create branches for each work. When, for example, you are working on a bug fix on version 3.0:

...

git checkout maintenance-3.x
git checkout -b fix/3.0/<ticket number>

...


4. Perform your works work in your new branch and commit . Ensure you get a clean build locally and your changes pass checkstyle and findbugs verification:

mvn -Pcheckstyle,findbugs -DskipTests clean install


5. Commit your changes and push to your own repository;

git

...

commit

...

<changed/worked

...

on

...

file>

...

 

5. Push your own repository;

git push <repo name> fix/3.0/<ticket number>

...


Info
titleNote

The prefix "fix" can be replaced with "feature", "improvement" or any other explanatory prefix depending on the work you perform.  


6. After changes are pushed, you should browse your newly pushed branch on Github website (e.g. https://github.com/<your username>/hazelcast/tree/fix/3.0/<ticket number>) and send a pull-request. For information on sending pull requests, please see https://help.github.com/articles/using-pull-requests.

...