1 / 77

Unleash the power of Git

Unleash the power of Git. Engage 2015. About us. Martin Jinoch jinoch@gmail.com @mjinoch http://jinoch.cz Jan Krejcárek jan.krejcarek@gmail.com @jan_krejcarek. What is Git actually?. It can give developers a safety net

priddy
Download Presentation

Unleash the power of Git

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. Unleash the power of Git Engage 2015

  2. About us Martin Jinoch jinoch@gmail.com @mjinoch http://jinoch.cz Jan Krejcárek jan.krejcarek@gmail.com @jan_krejcarek

  3. What is Git actually? • It can give developers a safety net • If something goes wrong with your code, you can get back to a last working version quickly • It means you won’t need any of those “Another Copy Of XY” elements anymore • It can store all versions of your application • No need to keep multiple NSF copies of your application in production and development, Git stores them all efficiently • It can keep history of your work • So you can get back on track faster • Oh, and by the way it is a great Version Control System

  4. Why use Git It’s 2015, using source control is part of programming craft It works as a basis for other tools (code review, automated builds, automatic testing)

  5. Git installation • Git is usually embedded in the IDE or it can be used separately as GUI or command line application • For Domino Designer you can install the EGit plugin (from OpenNTF) and for advanced tasks use a standalone application (SourceTree, GitEye and others) or a command line (msysgit)

  6. Install EGit • Download at OpenNTF • Project EGit for IBM Domino Designer • http://www.openntf.org/main.nsf/project.xsp?r=project/EGit%20for%20IBM%20Domino%20Designer

  7. Install EGit In Domino Designer select menu File – Application – Install…

  8. Install EGit Select option Search for new features to install

  9. Install EGit Add a new location pointing to the downloaded file Click Add Zip/Jar location and locate the org.openntf.egit.update.zip file

  10. Install EGit Select the new location and click Finish

  11. Install EGit Designer detects all features in the install location and lets you choose which ones you want to install Select the OpenNTF EGit Backport feature and click Next

  12. Install EGit Accept the license agreement terms and click Next Click Finish on the last window

  13. Install EGit If you see this window, confirm that you want to install the unsigned plugin When the installation is finished, restart Domino Designer and Notes and you are done!

  14. Or install SourceTree Download at http://www.sourcetreeapp.com/ Runs on a Mac or on Windows (requires .NET Framework)

  15. Install SourceTree

  16. Install SourceTree

  17. Install SourceTree To continue using SourceTree after 30 days you need to register it (it is free, you need to create an Atlassian account)

  18. Git’s basic principles Git repository Git stores file changes in a repository. Repository is a set of files in a .git directory.

  19. Git’s basic principles Git repository Working directory Git checks what files have changed by comparing repository with Working directory Working directory contains your Notes application design.

  20. Git’s basic principles Git repository Notes application Working directory (On-Disk project) Since Notes application design is stored in one NSF file, it needs to be “dumped” to a file system. This is done by creating an On-Disk project.Domino Designer synchronizesNotes application with the On-Disk project and vice versa.

  21. Setup Two settings control how Designer handles On-Disk projects Settings are available in Preferences in Domino Designer – Source Control category

  22. Setup • Use Binary DXL for source control operations • Design elements are dumped either in unreadable (binary) form or a normal readable Domino XML (DXL) form • Both are perfectly usable, normal form gives you at least something understandable • When working in teams, make sure everybody uses the same setting. • This setting affects all On-Disk projects

  23. Setup • Automatic export/import on modification • Whenever design element in the application changes, it is exported to an On-Disk project and vice versa • We prefer to disable this automation and to have full control over the process when files are moved between Notes app and the On-Disk project

  24. Put an app under Source Control • To setup source control for a Notes application, follow two steps: • Create an On-Disk project in Domino Designer • Create a Git repository for the On-Disk project

  25. Put an app under Source Control • Create an On-Disk project in Domino Designer • Right-click on the application title • Select Team Development – Set Up Source Control for this Application

  26. Put an app under Source Control • Create an On-Disk project in Domino Designer • Click next in the first helper dialog page

  27. Put an app under Source Control • Create an On-Disk project in Domino Designer • Specify the project nametip: use a short project name, there is no need to follow the convention for typical Eclipse projects • Specify a location (i.e.. C:\git\<application name>\<project name>)tip: Use a location outside of the Designer workspace and use a separate directory for every application • Click Finish

  28. Put an app under Source Control • Create an On-Disk project in Domino Designer • Designer switches to a Navigator view with two projects – one for the Notes application and another for the On-Disk project containing a dump of the application in a file system. A label shows that On-Disk project is associated with a Notes application

  29. Put an app under Source Control • Create a Git repository for the On-Disk project • Right click on the On-Disk project in Designer in Navigator view • Select Team – Share project

  30. Put an app under Source Control • Create a Git repository for the On-Disk project • Check the ‘Use or create repository in parent folder of project’ checkbox • Click on the project – the directory path is copied to a field below, remove the last part (the project’s folder name) • Click the Create Repository button

  31. Put an app under Source Control • Create a Git repository for the On-Disk project • .git directory gets created • click Finish

  32. Put an app under Source Control Application 1 Application 2 Git repository On-Disk project Git repository On-Disk project With this set up you will have a separate directory for each application with two subdirectories – the On-Disk project and the Git repository.

  33. Branches and Commits c4c9a21 0f6a728 e0f4d17 679587d Git stores your changes in commits Commit has an ID, an author and a message. It contains a set of changes made to one or more files You decide which files or even which changes go to a commit Commits are linked together forming a commit history

  34. Branches and Commits • Branches are identified by name • Branches in Git are “cheap” – they are easy and fast to create and delete • It is very common to create a branch for every new feature or bugfix, merge it to a main branch when done and delete that branch • Branch named “master” is created when a new Git repository is initialized • You can have as many branches as you want, one branch is always the active one, it is the branch where the next commit will go to* * Except when you forget to switch to proper branch first, then „git stash“ is your friend

  35. Branches and Commits cc612b1 0f6a728 c4c9a21 7921d25 fb93c0f 2b8fa20 • Usually you will have • a branch for the version in production (master) • a branch for development version (develop) • branches for individual features for the development version

  36. Branches and Commits Commits can be tagged with a name Use tags for individual versions of your application (ie. v1.0, v1.1 etc.) or mark some important commit This way you can easily retrieve a specific version (commit) quickly

  37. Back to track - Putting an app under Source Control We now have an On-Disk project and an empty Git repository As a next step we want to add the On-Disk project to Git repository (create a commit) and tag it as version 1.0 From that point we can start developing a new version

  38. Creating a first commit Right click on the On-Disk project in the Navigator view and select the Team – Commit option

  39. Creating a first commit In the dialog click the Select All button and write a commit message (like “Initial commit”) Click Commit and that’sit!

  40. Managing Git repository • The Git Repositories view allows you to manage your repositories • Select menu Windows – Show Eclipse Views – Other… • from the Git category select the Git Repositories view

  41. Git Repositories View View shows a list of branches and tags, highlights the active branch, allows you to create a new branch and switch to it, create tags etc. Right-click on the repository and select Show In – History view to see a historyfor the repository

  42. History View History view shows all commits either for the active branch or all branches For every commit you seeits date and time, commitmessage and a list of changedfiles and changes in those files Right click a commit and selectOpen in Commit Viewer toopen the commit in a biggerwindow

  43. Let’s make some changes • Now we want to make some changes to the application. For this we will: • Create a branch for development • Create a branch for each feature • Work on the features creating commits along the way • The point with feature branches is to have develop branch in always-working state

  44. Let’s make some changesCreating a new branch Open the Git Repositories view Right click on the master branch and select Create Branch… Enter the name “develop” for the development branch Do the same for a “feature/bootstrap” branch

  45. Let’s make some changesCreate a new branch We now have three branches New commits will be tied to the feature/bootstrap branch (it is the active branch)

  46. Let’s make some changesCreating new commits When you have made changes that you want to save to Git: • Synchronize your Notes Application with the On-Disk project • Right click on the application • Select Team Development- Sync with On-Disk project • Create a new commit

  47. Let’s make some changesCreating new commits You can review changed files before committing in a Git Staging view (open with menu Window – Show Eclipse views – Other)

  48. Changing last commit“Ooops, I mistyped the message” • You can change the last commit: • Right click on the repository in the Git Repositories view • Select Commit… • A message appears asking if You would like to amend the last commit. Click Yes • Change the message and commit • A new commit is actually created, replacing the previous one

  49. Changing last commit“Ooops, I forgot to include this file” • You can change the last commit even when you have a change to be committed: • Right click on the repository in the Git Repositories view • Select Commit… • Click the action for amending previous commit (message from the last commit is inserted) • Include files you need and/or change the commit message • Click commit

  50. Let’s make some changesMerging feature branch to develop • When your new feature is ready and working, you merge the feature branch to the develop branch • In Egit: • Checkout the develop branch (make it the active one) • Right click on the develop branch and select Merge..

More Related