Presentation is loading. Please wait.

Presentation is loading. Please wait.

CMSC433 Solving Project 0 Getting started with BitBucket, Git and Eclipse.

Similar presentations


Presentation on theme: "CMSC433 Solving Project 0 Getting started with BitBucket, Git and Eclipse."— Presentation transcript:

1 CMSC433 Solving Project 0 Getting started with BitBucket, Git and Eclipse

2 bitbucket Creating an account – https://bitbucket.org/ https://bitbucket.org/ CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 2

3 bitbucket Creating an account – https://bitbucket.org/ https://bitbucket.org/ – Sign up now, free CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 3

4 bitbucket Creating an account – https://bitbucket.org/ https://bitbucket.org/ – Sign up now, free – Validate address If you use your.edu address, you get the Unlimited Community License for Free! – Done? Not yet: don’t forget to update your first and last name in the account preferences! CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 4

5 Let’s get Project 0! Open the class BitBucket address: – https://bitbucket.org/cmsc433_spring2012/projec t0 https://bitbucket.org/cmsc433_spring2012/projec t0 Fork Project 0 – Don’t forget to concatenate your Directory ID to your forked repository! CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 5

6 Let’s get Project 0! Now you’re… almost ready to get the project skeleton code on your machine! – Before you can do it, you have to get a Git client first… CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 6

7 Git Download a Git client. Tutorials for all: – Windows 7: ET/Set+up+Git+and+Mercurial ET/Set+up+Git+and+Mercurial – Mac OSX: action?pageId= action?pageId= – Linux (Ubuntu): action?pageId= action?pageId= CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 7

8 Git (Windows users) You will need msysgit (1.7.8) – CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 8

9 Git (Windows users) You will need msysgit (1.7.8) – CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 9

10 Git (Windows users) Some tricks – Set the Git home directory (by default, it’s C:\Users\ ): Create a directory with this purpose (for example, D:\CMSC433\Git) Create a HOME environment variable CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 10

11 Git (Windows users) Some tricks – Set up your name and (so they appear nicely in BitBucket when you make changes to your repository) In Git Bash, type the commands: – git config --global user.name “ “ – git config --global user. – (notice that Git creates a file called.gitconfig with the information you provided) CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 11

12 Let’s get Project 0! Now you’re… almost ready to get the project skeleton code on your machine! – In the repository page, look for the HTTPS link… CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 12

13 Let’s get Project 0! Now you’re… almost ready to get the project skeleton code on your machine! – In the repository page, look for the HTTPS link… – Copy it, and paste it in the Git command window. Git will create a clone of the repository on your local machine… … but how annoying: you need to supply the password for your account. Can we get rid of that? CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 13

14 Git (Windows users) Let’s create a default ssh identity. – Run the command: ssh-keygen CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 14

15 Git (Windows users) Let’s create a default ssh identity. – Create a config file (indentation is important) (~/.ssh/config): – Restart your Git bash terminal CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 15

16 Git (Windows users) Let’s create a default ssh identity. – Let BitBucket know about your ssh identity: In your Account Settings page, look for the SSH keys section CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 16

17 Git (Windows users) Let’s create a default ssh identity. – Let BitBucket know about your ssh identity: In your Account Settings page, look for the SSH keys section Open the public key generated by ssh-keygen. (For example, D:\CMSC433\Git\.ssh\id_rsa.pub) Paste the contents into the text box, and click Add Key CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 17

18 Let’s get Project 0! Now you’re… almost ready to get the project skeleton code on your machine! – In the repository page, look for the HTTPS SSH link… – Copy it, and paste it in the Git command window. Git will create a clone of the repository on your local machine! CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 18

19 Let’s get Project 0! Let’s import Project 0 in Eclipse! – File > Import > General > Existing Projects into Workspace Or… use magic: CTRL+3 CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 19

20 Let’s get Project 0! Let’s import Project 0 in Eclipse! – File > Import > General > Existing Projects into Workspace – Select root directory: (point to the path where you cloned the project) CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 20

21 Let’s get Project 0! Let’s import Project 0 in Eclipse! – File > Import > General > Existing Projects into Workspace – Select root directory: (point to the path where you cloned the project) – Finish! CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 21

22 Let’s get Project 0! Let’s import Project 0 in Eclipse! – There’s a nicer way to do it: Window > Open Perspective > Other… > Git Repository Exploring Or… use magic: CTRL+3 CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 22

23 Let’s get Project 0! Let’s import Project 0 in Eclipse! – There’s a nicer way to do it: Window > Open Perspective > Other… > Git Repository Exploring Add an existing Git repository CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 23

24 Let’s get Project 0! Let’s import Project 0 in Eclipse! – There’s a nicer way to do it: Window > Open Perspective > Other… > Git Repository Exploring Add an existing Git repository Point to the location of your project 0 clone, and hit Search: CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 24

25 Let’s get Project 0! Let’s import Project 0 in Eclipse! – There’s a nicer way to do it: Window > Open Perspective > Other… > Git Repository Exploring Add an existing Git repository Point to the location of your project 0 clone, and hit Search. Select your clone, and click ok. CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 25

26 Let’s get Project 0! Let’s import Project 0 in Eclipse! – There’s a nicer way to do it (cont’d): Import project into your workspace CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 26

27 Let’s get Project 0! Let’s import Project 0 in Eclipse! – Actually… there’s an even nicer way to do it: Instead of using Git Bash, you could do everything from Eclipse! File > Import… > Git > Projects from Git > Clone… In the URI field, paste the SSH URI from BitBucket. In the protocol field, select SSH CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 27

28 Let’s get Project 0! Let’s import Project 0 in Eclipse! – Actually… there’s an even nicer way to do it: Instead of using Git Bash, you could do everything from Eclipse! File > Import… > Git > Projects from Git > Clone… In the URI field, paste the SSH URI from BitBucket. In the protocol field, select SSH CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 28

29 Let’s get Project 0! Let’s import Project 0 in Eclipse! – Actually… there’s an even nicer way to do it: Choose a Local Destination CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 29

30 Let’s get Project 0! Let’s import Project 0 in Eclipse! – Actually… there’s an even nicer way to do it: Choose a Local Destination Select the Git repository to import CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 30

31 Let’s get Project 0! Let’s import Project 0 in Eclipse! – Actually… there’s an even nicer way to do it: Choose a Local Destination Select the Git repository to import Done! CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 31

32 Let’s get Project 0! Let’s import Project 0 in Eclipse! – Note: Whenever you import a Git project to Eclipse via the Git UI, you get some additional Eclipse functionality, via the Team menu: CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 32

33 Let’s solve Project 0! Taking a look at Project 0 (ParallelSum) – Run test – Implement the test method: ParallelAdderTest.testTotalSum() – Run test again… – Implement ParallelAdderWorker.run() – Run test again… – Implement ParallelAdderWorker.getPartialSum() – Run test again… CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 33

34 Let’s solve Project 0! Submit your solution: – Run git add on your modified files. (in Git Bash) Or use the Eclipse Team menu – Run git commit –m “…” – Run git push – See your changes online: https://bitbucket.org/ /project0- CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse) 34

35 QUESTIONS?

36 THE END


Download ppt "CMSC433 Solving Project 0 Getting started with BitBucket, Git and Eclipse."

Similar presentations


Ads by Google