1 / 36

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

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

stash
Download Presentation

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

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. bitbucket • Creating an account • https://bitbucket.org/ • Sign up now, free 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 .eduaddress, 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)

  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! 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… 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 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 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 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 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: • gitconfig --global user.name “<first name> <last name>“ • gitconfig --global user.email“<your_email>@umd.edu“ • (notice that Git creates a file called .gitconfig with the information you provided) 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… 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? 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 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 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 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 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 HTTPSSSH 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)

  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)

  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) 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! 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 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 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: 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. 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 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 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 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 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 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! 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: 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… 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> CMSC433 Solving Project 0 (Getting started with BitBucket, Git and Eclipse)

  35. QUESTIONS?

  36. THE END

More Related