Starting from:

$29.99

Lab Assignment 15 – Branching and Merging in GitHub

Lab Assignment 15 – Branching and Merging in GitHub
1. Click on file  New project option.
2. Select Java Project.
3. Give your project name as Sorting and click Finish button.
4. Now, right click src under your project  select class (i.e. Java class)
5. Give your Java class name as BubbleSort and make sure to check void main box  click finish
button.
This is how it will look like.
6. Go to your GitHub account and create a new repository with same name as of project (i.e. Sorting).
Screen shot after creating new repository.

7. Right click on your project in eclipse and go to Team option  click on share project.
8. It will ask for configuring Git Repository.Make sure to check User or Create check box, select the
path, and click on create repository button.
Note: Eclipse may ask you for your GitHub credentials here. If it asks, then go to step 12.
9. Complete bubble sort program and run.
10. Right click on your project  go to team option  select commit.
11. Type a commit message  click on commit and pushbutton.
12. Eclipse will ask for your GitHub credentials  enter details  Click next.
13. Click next  click finish
14. Your project will be pushed in the Git repository. Refresh your Gitrepository (i.e.sorting) and look
for BubbleSort.java file in your repository.
15. To create a new branch, right click on project  go to team option  switch to  click on new
branch.
16. Enter name of your new branch and click on finish button.
17. Now, right click src under your project  select class (i.e. Java class).
18. Type the name of the class that you prefer (I used NewSort) and make sure to check void main
box  click finish button.
This is how it looks like.
19. Create your new sorting program  save  run.
20. Right click on your project  go to team option  select commit.
21. Type commit message  drag new file to Staged changes box  click commit andpush.
22. Leave defaults and click next.
23. Click finish. It will push your file to repository in the new branch.
24. Refresh your repository and select new branch.
25. You will see a new java file (i.e. NewSort.java) is added to NewSort branch.
26. Now, your new sorting program is working fine and you want it to merge in your master branch.
To do so, switch to master branch. Right click on project  team  switch to master.
27. Right click on project  team merge.
28. Select NewSort branch and click merge button.
29. Select your branch and click OK button.
30. Right click on project  team commit.
31. Make sure to drag all files to staged changes  type commit message  click on commit and
push button.
32. Refresh your repository and switch to master branch. You will see both the programs in master
branch.
Submit screenshot (e.g., image in step 32) of master as well as new branch that you created (mine is
NewSort) along with both the sorting programs (i.e. java files) as well as link to your Git repository as your
lab assignment 3.
Total five files: 2 screenshots, 2 java files, and link in 1 text file

More products