Checkitmobile Git Workshop

506 views
403 views

Published on

Little Git-Workshop to use Git with Netbeans

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
506
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Checkitmobile Git Workshop

  1. 1. <ul><ul><li>The Basic Git Workflow … and what has been changed </li></ul></ul>01.2012
  2. 2. Moving from remote to local The 1st and biggest change you should always remember: You're now working with a local Repository. Instead of commiting directly to remote, you'll commit from now on to your local Repository. Updating remote is done later. Why is this useful? Because it's not more centralized - we can now create commits even if we're offline or share branches with Team-Members directly.
  3. 3. Moving from remote to local
  4. 4. Moving from remote to local create a first local commit $ git commit -A -m „1st commit“ create a second local commit $ git commit -A -m „2nd commit“ send both local commit's to remote $ git push origin master remote repository origin/master
  5. 5. <ul><ul><li>Prepare commits with the Staging Area </li></ul></ul>The Staging Area is something like a loading ramp to prepare your next commit. So if you want to create a commit, you'll need to fill at first the Staging Area with a Set of files (which has been changed). Why is this useful? Instead of creating a commit in one big line, you can prepare commits and review it calmly. If you're sure everything is fine, you can easily commit the files from the Staging Area.
  6. 6. $ git status Changes not staged for commit: … Gemfile … app/controllers/application.rb $ git add . $ git status Changes to be committed: … Gemfile … app/controllers/application.rb $ git commit -m „remove comments“ [master] remove comments - 2 files changed, 2 deletions(-)
  7. 7. <ul><ul><li>Push changes to a remote Repository </li></ul></ul>After creating commits within our local repository. It's time to update the remote Repository and share our changes. Our remote Repository is called „origin“ and it contains a „master“-Branch, which is basicly the trunk of our Git-Repository. Later we can create additional sources like „birke“, to push changes from our local repository directly to a member. $ git push origin master
  8. 8. <ul><ul><li>Pull changes from remote to local </li></ul></ul>The last step in the list of changes is to pull changes from remote to our local Repository. Like mentioned before, we're possible to pull from different remote sources. $ git pull origin master
  9. 9. <ul><ul><li>Using Git with Netbeans </li></ul></ul>Install Netbeans 7.01 with RubyOnRails and Git-Plugin
  10. 10. <ul><ul><li>Using Git with Netbeans - Basics </li></ul></ul>Git -> Show Changes : Display a window with all changed files Git -> Add : Add files to Staging Area Git -> Checkout files : Revert file to a given revision Git -> Revert modifications : Revert uncommited changes Git -> Show History : Revert uncommited changes
  11. 11. <ul><ul><li>Using Git with Netbeans - Committing </li></ul></ul>Select Git -> Commit . Enter your message Commit the changes to your local Repository.
  12. 12. <ul><ul><li>Using Git with Netbeans – Pushing </li></ul></ul>To share commits with your Team, you'll need to push the local commit to the remote Repository. 1. Select Git->Push . 2. On the first step you'll see the Address of the remote Repository (keep it as it is) and click Next. 3. Select the Master-Branch and click once again on Next. 4. Keep the preselected Branch on remote and finally push your commits to remote.
  13. 13. <ul><ul><li>Using Git with Netbeans - Pushing </li></ul></ul>
  14. 14. <ul><ul><li>Using Git with Netbeans – Pulling </li></ul></ul>To receive commits from your Team, you'll need to pull commits from the remote Repository. 1. Select Git->Pull . 2. On the first step you'll see the Address of the remote Repository (keep it as it is) and click Next. 3. Select the Master-Branch and click on Finish. You'll now receive the latest commits from remote.
  15. 15. <ul><ul><li>Updating Pandora </li></ul></ul>To keep Pandora up2date, use the pull-command to receive the latest commits from remote. $ ssh [email_address] $ cd CimRails/ $ git pull origin master And reload Apache if necessary
  16. 16. <ul><ul><li>Resources </li></ul></ul>Install Git with Netbeans on Ubuntu/Mac https://support.berlitec.de/projects/woabi/wiki/Setup_Netbeans_701_with_Git Git CheatSheet /cimdocs/ebooks/git/Git-Cheatsheet.pdf
  17. 17. Contact checkitmobile GmbH Gerrit Wanderer Ruby on Rails-Developer Waldemarstr. 37a 10999 Berlin Tel: +49 30 921 228 61 Mail: [email_address]

×