cmsc433 solving project 0 getting started with bitbucket , git and eclipse

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

Upload: stash

Post on 22-Feb-2016

57 views

Category:

Documents


0 download

DESCRIPTION

CMSC433 Solving Project 0 Getting started with BitBucket , Git and Eclipse. bitbucket. Creating an account https://bitbucket.org/. bitbucket. Creating an account https://bitbucket.org/ Sign up now, free. bitbucket. Creating an account https://bitbucket.org/ Sign up now, free - PowerPoint PPT Presentation

TRANSCRIPT

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

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

Page 2: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

2

bitbucket

• Creating an account– https://bitbucket.org/

Page 3: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

3

bitbucket

• Creating an account– https://bitbucket.org/– Sign up now, free

Page 4: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

4

bitbucket

• Creating an account– https://bitbucket.org/– Sign up now, free– Validate email 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!

Page 5: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

5

Let’s get Project 0!

• Open the class BitBucket address:– https://

bitbucket.org/cmsc433_spring2012/project0

• Fork Project 0– Don’t forget to concatenate your Directory ID to

your forked repository!

Page 6: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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…

Page 7: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

7

Git

• Download a Git client. Tutorials for all:– Windows 7:

http://confluence.atlassian.com/display/BITBUCKET/Set+up+Git+and+Mercurial

– Mac OSX: http://confluence.atlassian.com/pages/viewpage.action?pageId=269981802

– Linux (Ubuntu): http://confluence.atlassian.com/pages/viewpage.action?pageId=269982882

Page 8: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

8

Git (Windows users)

• You will need msysgit (1.7.8)– http://code.google.com/p/msysgit/downloads/list

Page 9: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

9

Git (Windows users)

• You will need msysgit (1.7.8)– http://code.google.com/p/msysgit/downloads/list

Page 10: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

10

Git (Windows users)

• Some tricks– Set the Git home directory (by default, it’s C:\

Users\<username>):• Create a directory with this purpose (for example, D:\

CMSC433\Git)• Create a HOME environment variable

Page 11: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

11

Git (Windows users)

• Some tricks– Set up your name and email (so they appear nicely in

BitBucket when you make changes to your repository)• In Git Bash, type the commands:

– git config --global user.name “<first name> <last name>“– git config --global user.email “<your_email>@umd.edu“

– (notice that Git creates a file called .gitconfig with the information you provided)

Page 12: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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…

Page 13: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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?

Page 14: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

14

Git (Windows users)

• Let’s create a default ssh identity.– Run the command: ssh-keygen

Page 15: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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

Page 16: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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

Page 17: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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

Page 18: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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!

Page 19: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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

Page 20: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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 clonedthe project)

Page 21: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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 clonedthe project)

– Finish!

Page 22: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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

Page 23: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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

Page 24: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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:

Page 25: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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.

Page 26: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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

Page 27: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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

Page 28: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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

Page 29: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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

Page 30: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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

Page 31: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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!

Page 32: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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:

Page 33: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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…

Page 34: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

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

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/<user>/project0-<dirId>

Page 35: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

QUESTIONS?

Page 36: CMSC433 Solving Project 0 Getting started with  BitBucket ,  Git  and Eclipse

THE END