Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Slide 1 of 55© People Strategists www.peoplestrategists.com
Exploring Maven,
SVN and GIT
Slide 2 of 55© People Strategists www.peoplestrategists.com
Objectives
In this session, you will learn to:
Explore Maven
I...
Slide 3 of 55© People Strategists www.peoplestrategists.com
Exploring Maven
Maven:
Is a Yiddish word that means "accumulat...
Slide 4 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Maven repositories are used to store ...
Slide 5 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Maven project structure of core appli...
Slide 6 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Maven project structure of Web applic...
Slide 7 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Following table lists the description...
Slide 8 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Project Object Model (POM):
It was na...
Slide 9 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Some important terms used in pom.xml ...
Slide 10 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
SNAPSHOT: It is a special version th...
Slide 11 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Two types of the POM are:
Minimal PO...
Slide 12 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Minimal POM:
It contains only the ne...
Slide 13 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Super POM:
It is Maven's default POM...
Slide 14 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven
The following table lists the...
Slide 15 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven (Contd.)
To install and set u...
Slide 16 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven (Contd.)
To set up JDK in win...
Slide 17 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven (Contd.)
To install Maven in ...
Slide 18 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven (Contd.)
To set these in wind...
Slide 19 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven (Contd.)
In order to use Mave...
Slide 20 of 55© People Strategists www.peoplestrategists.com
Creating and Building Web Application Using Maven
Consider a ...
Slide 21 of 55© People Strategists www.peoplestrategists.com
Introducing Version Control System
Version Control System (VC...
Slide 22 of 55© People Strategists www.peoplestrategists.com
Introducing Version Control System (Contd.)
Centralized Versi...
Slide 23 of 55© People Strategists www.peoplestrategists.com
Introducing Version Control System (Contd.)
Some of the VCS t...
Slide 24 of 55© People Strategists www.peoplestrategists.com
Introducing Version Control System (Contd.)
Working copy:
 I...
Slide 25 of 55© People Strategists www.peoplestrategists.com
Exploring Subversion
Subversion (SVN):
Is often abbreviated a...
Slide 26 of 55© People Strategists www.peoplestrategists.com
Exploring Subversion (Contd.)
To install TortoiseSVN, follow ...
Slide 27 of 55© People Strategists www.peoplestrategists.com
Creating Repository in Subversion
Creating a repository in To...
Slide 28 of 55© People Strategists www.peoplestrategists.com
Creating Repository in Subversion (Contd.)
By default, the re...
Slide 29 of 55© People Strategists www.peoplestrategists.com
Creating Repository in Subversion (Contd.)
Adding a project t...
Slide 30 of 55© People Strategists www.peoplestrategists.com
Creating Repository in Subversion (Contd.)
Creating a working...
Slide 31 of 55© People Strategists www.peoplestrategists.com
Creating Repository in Subversion (Contd.)
Updating the proje...
Slide 32 of 55© People Strategists www.peoplestrategists.com
Merging Code and Avoiding Conflict
Merging a project:
Right-c...
Slide 33 of 55© People Strategists www.peoplestrategists.com
Merging Code and Avoiding Conflict (Contd.)
Merge a range of ...
Slide 34 of 55© People Strategists www.peoplestrategists.com
Exploring GIT
GIT:
Was initially developed by Linus Torvalds ...
Slide 35 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Basic workflow of GIT is:
Modify the c...
Slide 36 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Detailed workflow of GIT is:
Clone the...
Slide 37 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Installing GIT:
Download the software ...
Slide 38 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Click the Next button. The next screen...
Slide 39 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Click the Next button. The next screen...
Slide 40 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Creating a repository:
Open the git Ba...
Slide 41 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Some of the GIT commands are listed in...
Slide 42 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Command Syntax Description
add git add...
Slide 43 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Some of the GIT Graphical User Interfa...
Slide 44 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Installing and configuring GitEye:
Dow...
Slide 45 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Creating a new repository:
Click the C...
Slide 46 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Click the Finish button. The Git Repos...
Slide 47 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Adding an existing repository:
Click t...
Slide 48 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Browse and select the desired reposito...
Slide 49 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Select the source. For example, GitHub...
Slide 50 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Select a repository and click Next. Th...
Slide 51 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Modifying a file:
Double-click to chec...
Slide 52 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Committing changes to the remote repos...
Slide 53 of 55© People Strategists www.peoplestrategists.com
Summary
In this session, you learned that:
Maven is a tool th...
Slide 54 of 55© People Strategists www.peoplestrategists.com
Summary (Contd.)
Repository is the central place where develo...
Slide 55 of 55© People Strategists www.peoplestrategists.com
Summary (Contd.)
TortoiseSVN is a centralized version control...
Upcoming SlideShare
Loading in …5
×

Exploring Maven SVN GIT

1,266 views

Published on

MS

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Exploring Maven SVN GIT

  1. 1. Slide 1 of 55© People Strategists www.peoplestrategists.com Exploring Maven, SVN and GIT
  2. 2. Slide 2 of 55© People Strategists www.peoplestrategists.com Objectives In this session, you will learn to: Explore Maven Install and set up Maven Create and build Web application using Maven Manage Dependency Introduce version control system Explore subversion Create repository in subversion Merge code and avoid conflict Explore GIT Explore GitEye
  3. 3. Slide 3 of 55© People Strategists www.peoplestrategists.com Exploring Maven Maven: Is a Yiddish word that means "accumulator of knowledge". Is a tool that can be used for building and managing any Java based project. Is based on the concept of a Project Object Model (POM), which is an xml file. Helps Java Developers to understand the structure of a Java-based project by providing a proper directory structure. Provides collection of jar files known as Maven repositories. Provides set of commands to download and make use of Maven repositories. Maven commands can be used from the Windows command prompt.
  4. 4. Slide 4 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Maven repositories are used to store constructed artifacts and dependencies of several types. The two types of Maven repositories are: Remote repositories:  Mean repositories accessed by different protocols, such as file:// and http://.  Might be central repositories, which are developed by Maven community, or by a third party to provide their artifacts for downloading.  For example, the repo.maven.apache.org is a central repository and http://maven.objectify-appengine.googlecode.com/git/ is a third party repository. Local repositories:  Refer to a copy of remote downloads on your computer.  Are cache of the remote downloads and contains the temporary build artifacts that you have not yet released. Maven archetypes (readymade templates) allow users to create projects using templates, which are based on common scenarios.
  5. 5. Slide 5 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Maven project structure of core application: Project Home Project Structure of Core Application
  6. 6. Slide 6 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Maven project structure of Web application: Project Home Project Structure of Web Application
  7. 7. Slide 7 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Following table lists the description of the project structure. Folder Description project home Contains the pom.xml and all subdirectories. src/main/java Contains the Java classes for the project. src/main/resources Contains the deliverable resources for the project, such as property files. src/main/webapp Contains the html or jsp files. src/main/webapp/WEB- INF Contains all the configuration files, such as web.xml. src/main/webapp/css Contains all the stylesheet files of the Web application. src/test/java Contains the testing classes (JUnit or TestNG test cases) for the project. src/test/resources Contains resources necessary for testing.
  8. 8. Slide 8 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Project Object Model (POM): It was named project.xml in earlier version of Maven. It is the fundamental unit of work in Maven. It is an XML file that contains information about the project. It always resides in the base directory of the project as pom.xml. It also contains the configuration details, such as plugin, goals, build profiles and various dependencies used by Maven to build the project.
  9. 9. Slide 9 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Some important terms used in pom.xml are: project: It is the root element for the pom.xml file. modelVersion: It indicates the version of the project object model. groupId: It identifies your project uniquely across all projects. If a user uses your project, it serves as an attribute of the dependency in pom.xml. artifactId: It is the name of your project within Maven and specifies the artifact's location within the repository. version: It refers to the initial maven version of your project. It is used within an artifact's repository to maintain different copy of an application. If you want that your artifact should be using last deployed version, you can suffix the version with –SNAPSHOT. package: It refers to the Java package that is created while creating a project.
  10. 10. Slide 10 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) SNAPSHOT: It is a special version that indicates a current development copy of your artifact. Unlike regular versions, Maven checks for a new SNAPSHOT version in a remote repository and fetches the last deployed version for every build. plugin: It defines the plugin you project is using. dependency: It defines the version of the project object model. Maven uses the pom.xml file in the following order: Read the pom.xml file and parse the content. Download dependencies to local dependency repository. Execute life cycle/build phase/goal. Execute plugins, if any.
  11. 11. Slide 11 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Two types of the POM are: Minimal POM Super POM
  12. 12. Slide 12 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Minimal POM: It contains only the necessary elements, which are:  project  modelVersion  groupId  artifactId  version The following code illustrates the minimal POM: <project> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <version>1</version> </project>
  13. 13. Slide 13 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Super POM: It is Maven's default POM and can comprise of all the elements. The following code illustrates super POM: <project> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <version>1</version> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.3</version> </plugin> </plugins> <dependencies> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-artifact</artifactId> <version>${mavenVersion}</version> </dependency> </project>
  14. 14. Slide 14 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven The following table lists the system requirements for installing Maven. Item Requirements JDK Maven 3.2 requires JDK 1.6 or above Maven 3.0/3.1 requires JDK 1.5 or above Memory No minimum requirement Disk 10MB for the Maven installation itself. At least 500MB for your local Maven repository. Operating System No minimum requirement.
  15. 15. Slide 15 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven (Contd.) To install and set up Maven, You need to perform following steps: Set up JDK Install Maven Set Maven environment variables Configure system path
  16. 16. Slide 16 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven (Contd.) To set up JDK in windows, you need to perform following steps: Download the latest SDK from the URL, http://www.oracle.com/technetwork/java/javase/downloads/in dex.html. Set the JAVA_HOME path to C:Program FilesJavajdk1.8.0 path. Set the PATH variable to C:Jdk_Folderbin;%PATH%;. To set up JDK in linux, you need to perform following steps: Download the latest SDK from the URL, http://www.oracle.com/technetwork/java/javase/downloads/in dex.html. Type export JAVA_HOME=/usr/local/jdk on command prompt. Type export PATH=$PATH:$JAVA_HOME/bin/ on command prompt. Set up JDK
  17. 17. Slide 17 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven (Contd.) To install Maven in windows, You need to perform following steps: Go to the URL, http://maven.apache.org/download.cgi to download installation file for your target system. Extract the file to a directory. For example, C:apache-maven. In linux, extract the file to the following directory: /usr/local/apache-maven Install Maven
  18. 18. Slide 18 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven (Contd.) To set these in windows, you need to perform following steps: Set M2_HOME to C:apache-maven-install-path. Set M2 to %M2_HOME%bin. Set MAVEN_OPTS to -Xms256m -Xmx512m. To set these in linux, you need to perform following steps: Type export M2_HOME=/usr/local/apache-maven-install-path on command prompt. Type export M2=$M2_HOME/bin on command prompt. Type export MAVEN_OPTS=-Xms256m -Xmx512m on command prompt. Set Maven environment variables
  19. 19. Slide 19 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven (Contd.) In order to use Maven command line tools anywhere on a system, we have to add Maven bin directory location to system path. To do this in windows, you need to perform following step: Append the string ;%M2% to the end of the system variable PATH. To do this in linux, you need to perform following step: Type export PATH=$M2:$PATH on command prompt. Configure system path
  20. 20. Slide 20 of 55© People Strategists www.peoplestrategists.com Creating and Building Web Application Using Maven Consider a scenario where you need to develop a Web application, helloworld that displays a message “Welcome to Maven World.” For this, you want to use the maven archetype. The expected output of the Web application is shown in the following figure. The Expected Output
  21. 21. Slide 21 of 55© People Strategists www.peoplestrategists.com Introducing Version Control System Version Control System (VCS) is a software that helps software developers to work together and maintain a complete history of their work. The Goals of VCS are: It allows developers to work simultaneously. It does not overwrite each other’s changes. It maintains history of every version of everything. Two categories of VCS are: Centralized Version Control System (CVCS) Distributed/Decentralized Version Control System (DVCS)
  22. 22. Slide 22 of 55© People Strategists www.peoplestrategists.com Introducing Version Control System (Contd.) Centralized Version Control System (CVCS): Uses a central server to store all files and enables team collaboration. Stores the files on a single machine called server. Some examples are SVN and Perforce. Distributed/Decentralized Version Control System (DVCS): Checks out the latest snapshot of the directory and fully mirrors the repository. Allows any client to copy back the checked out repository to the server to restore it. Does not rely on the central server. Allows you to perform operations, such as commit changes, create branches, and view logs while you are offline. Needs network connection only to publish your changes and take the latest changes. Some examples are GIT and Darcs.
  23. 23. Slide 23 of 55© People Strategists www.peoplestrategists.com Introducing Version Control System (Contd.) Some of the VCS terminologies are: Repository:  Is the heart of any version control system.  Is the central place where developers store all their work.  Stores files as well as the history.  Is accessed over a network, acting as a server and version control tool acting as a client. Trunk:  Is a directory where all the main development happens and is usually checked out by developers to work on the project. Branches:  is used to create another line of development.  Is useful to keep separate the new version of a software from the fixes of the old version.
  24. 24. Slide 24 of 55© People Strategists www.peoplestrategists.com Introducing Version Control System (Contd.) Working copy:  Is a snapshot of the repository.  Is a private workplace where developers can do their work remaining isolated from the rest of the team. Tags:  Use tag directory to store named snapshots of the project.  Is a descriptive and memorable name given to a specific version in the repository. Commit changes:  Is the act of committing the changes made in the working copy to the repository.  Is rolled back if an error comes in between the process of commit. URL:  Represents the location of the repository on the server.
  25. 25. Slide 25 of 55© People Strategists www.peoplestrategists.com Exploring Subversion Subversion (SVN): Is often abbreviated as SVN and falls under CVCS. Is developed as a project of the Apache Software Foundation. Is a software versioning and revision control system distributed under an open source license. Is part of a rich community of developers and users. Is a software that helps software developers to maintain a complete history files. Some of the available SVNs are: SlikSVN (32- and 64-bit client MSI) VisualSVN (32- and 64-bit client and server) WANdisco (32- and 64-bit client and server) TortoiseSVN (32-bit and 64-bit)
  26. 26. Slide 26 of 55© People Strategists www.peoplestrategists.com Exploring Subversion (Contd.) To install TortoiseSVN, follow the following steps: Download the software from URL, http://tortoisesvn.net/downloads.html. Double-click the .msi file, the setup dialog box appears, as shown in the following figure. Follow the instructions to install the software. The Setup Dialog Box
  27. 27. Slide 27 of 55© People Strategists www.peoplestrategists.com Creating Repository in Subversion Creating a repository in TortoiseSVN: Create a new folder in your desired drive. Right-click the folder and select TortoiseSVN -> Create repository here. The Repository created dialog box appears as shown in the following figure. Click the Create folder structure button. Click the OK button. The Repository created Dialog Box
  28. 28. Slide 28 of 55© People Strategists www.peoplestrategists.com Creating Repository in Subversion (Contd.) By default, the repository has a folder layout, as shown in the following figure. Right-click the repository and select TortoiseSVN -> Repo-browser. It shows the folders, as shown in the following figure. The Folder Layout Repository Browser
  29. 29. Slide 29 of 55© People Strategists www.peoplestrategists.com Creating Repository in Subversion (Contd.) Adding a project to your repository: Right-click the desired project. Select TortoiseSVN -> Import. The Import dialog box appears. Click the OK button. The project gets imported to the repository. Click the OK button to close the Import dialog box.
  30. 30. Slide 30 of 55© People Strategists www.peoplestrategists.com Creating Repository in Subversion (Contd.) Creating a working directory: Right-click project folder. Select SVN Checkout. The Checkout dialog box appears, as shown in the following figure. Click the OK button to checkout the project. The Checkout Dialog Box
  31. 31. Slide 31 of 55© People Strategists www.peoplestrategists.com Creating Repository in Subversion (Contd.) Updating the project with latest version: Right-click project folder in working directory. Select SVN Update. The Update finished dialog box appears. Click the OK button. Committing the changes: Right-click project folder in working directory. Select SVN commit. The Commit dialog box appears. Click the OK button. Reversing the changes: Right-click project folder in working directory. Select TortoiseSVN -> Revert. Select the version you want to revert in the Revert dialog box. Click the OK button.
  32. 32. Slide 32 of 55© People Strategists www.peoplestrategists.com Merging Code and Avoiding Conflict Merging a project: Right-click project folder. Select TortoiseSVN -> Merge. The Merge dialog box appears, as shown in the following figure. Select Merge type, which are:  Merge a range of revisions  Merge two different trees The Merge Dialog Box
  33. 33. Slide 33 of 55© People Strategists www.peoplestrategists.com Merging Code and Avoiding Conflict (Contd.) Merge a range of revisions merges two versions of a project from one branch to other. Merge two different trees merge the differences of two different branches into your working copy. Click Next. Select revision range, which are:  All revisions: It merges all the revisions.  Specific range: It merges the specified range.  Reverse merge: It merges the versions in reverse order. Click the Next button. Click the Merge button.
  34. 34. Slide 34 of 55© People Strategists www.peoplestrategists.com Exploring GIT GIT: Was initially developed by Linus Torvalds for Linux kernel development. Is a distributed revision control and source code management system. Is a free software distributed under the terms of the GNU General Public License. Is fast as most of the operations are performed locally. Uses a common cryptographic hash function called secure hash function (SHA1), to name and identify objects within its database. Terms related to GIT are: Local repository: It is private workplace where developers make changes. Working directory: It is the place where files are checked out. Staging area: It is the place where GIT looks for the files while committing the changes to GIT repository. Pull: It copies the changes from a remote repository instance to a local one. Push: It copies changes from a local repository to a GIT repository.
  35. 35. Slide 35 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Basic workflow of GIT is: Modify the checked out file from the working directory. Add these files to the staging area. Perform commit operation that moves the files from the staging area to GIT repository. Basic Workflow of GIT
  36. 36. Slide 36 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Detailed workflow of GIT is: Clone the GIT repository as a working copy. Modify the working copy by adding/editing files. Update the working copy by taking other developer's changes, if any. Review the changes and commit. Push the changes to the repository. Detailed Workflow of GIT
  37. 37. Slide 37 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Installing GIT: Download the software from URL, https://git-scm.com/download/win. Double-click the setup file. The Git Setup dialog box appears, as shown in the following figure. Click the Next button. The Git Setup Dialog Box
  38. 38. Slide 38 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Click the Next button. The next screen appears, as shown in the following figure. Select all the check boxes and click the Next button. Click the Next button. The Git Setup Dialog Box
  39. 39. Slide 39 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Click the Next button. The next screen appears, as shown in the following figure. Click the Next button in the next screens to install the software. The Git Setup Dialog Box
  40. 40. Slide 40 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Creating a repository: Open the git Bash file from the installation directory. The command prompt window appears, as shown in the following figure. Type git init myrepository and press Enter. The repository gets initialized or created, as shown in the following figure. The Command Prompt Window The Command Prompt Window
  41. 41. Slide 41 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Some of the GIT commands are listed in the following table: Command Syntax Description init git init <directory> Creates a .git subdirectory in the project root, which contains all of the necessary metadata for the repository. init --bare git init -- bare <directory> Initializes an empty git repository, but omit the working directory. clone git clone <repo> Copies an existing git repository to local file system. git clone <repo> <directory> Copies an existing git repository to the specified directory. config git config user.name <name> Defines the author name to be used for all commits in the current repository. git config --global user.name <name> Defines the author name to be used for all commits in the current repository by the current user. git config --global user.email <email> Defines the author email to be used for all commits by the current user.
  42. 42. Slide 42 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Command Syntax Description add git add <file> Stages all changes in <file> for the next commit. git add <directory> Stage all changes in <directory> for the next commit. git add -p lets you choose portions of a file to add to the next commit. commit git commit Commits the snapshot in the staging area. git commit -a Commits a snapshot of all changes in the working directory. status git status Lists the files’ status, such as staged, unstaged, and untracked. log git log Displays committed snapshots. git log -n <limit> Limits the number of commits by <limit>. For example, git log -n 3 will display only 3 commits.
  43. 43. Slide 43 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Some of the GIT Graphical User Interface tool are: GIT Extension SourceTree SmartGit. GitEye GitEye: Is a popular distributed version control and source code management (SCM) system. Improves GIT performance through an intuitive graphical interface that simplifies all GIT commands. Is pre-integrated with CloudForge, TeamForge and GitHub, and works on most platforms. Provides easy access to all GIT functions and repositories, and can be used with cloud or on-premise GIT repositories.
  44. 44. Slide 44 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Installing and configuring GitEye: Download the GitEye software from the https://www.collab.net/downloads/giteye URL. Unzip and store the files in GitEye folder in your local drive. Double-click the GitEye.exe file. The CollabNet GitEye window appears, as shown in the following figure. The CollabNet GitEye Window
  45. 45. Slide 45 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Creating a new repository: Click the Create Repository button. The Create a Git Repository dialog box appears, as shown in the following figure. Browse the location where you want to create the repository. Select Create as bare repository if you want to create a blank repository. The Add Git Repositories Dialog Box
  46. 46. Slide 46 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Click the Finish button. The Git Repositories window displays the newly created repository, as shown in the following figure. The Git Repositories Window
  47. 47. Slide 47 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Adding an existing repository: Click the Add Repository button. The Add Git Repositories dialog box appears, as shown in the following figure. The Add Git Repositories Dialog Box
  48. 48. Slide 48 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Browse and select the desired repository. For example, mygit. Click the Finish button. Cloning a repository: Create a user account on the repository’s URL, such as github.com. Click the Clone Repository button. The Clone Git Repository dialog box appears, as shown in the following figure. The Clone Git Repository Dialog Box
  49. 49. Slide 49 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Select the source. For example, GitHub. Click the Next button. Select search parameter. Type a text (for example, app) and click the Search button. Repositories gets populated, as shown in the following figure. The Clone Git Repository Dialog Box
  50. 50. Slide 50 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Select a repository and click Next. The Branch Selection page appears. Select the checkboxes you need. Click the Next button. Click the Finish button. The repository gets added to the Git Repositories window, as shown in the following figure. The Git Repositories Window
  51. 51. Slide 51 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Modifying a file: Double-click to checkout the directory or file you want to modify. Locate the files in your local drive. Make the changes as per you need. Save the changes. You can make the changes in the Working directory. Pushing a file: Select the directory or file in the repository. Go to Git-> Push to Upstream. Enter your credential. Click the OK button.
  52. 52. Slide 52 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Committing changes to the remote repository: Right-click directory or file you want to commit. Select Commit. The Commit Changes dialog box appears. Type the description in the Commit message text area. Select Files. Click the Commit button. If files are changed, files will be committed otherwise “There are no staged files.” error will be displayed.
  53. 53. Slide 53 of 55© People Strategists www.peoplestrategists.com Summary In this session, you learned that: Maven is a tool that can be used for building and managing any Java based project. Maven provides collection of jar files known as Maven repositories. The two types of Maven repositories are:  Remote repositories  Local repositories Maven archetypes allow users to create projects using templates, which are based on common scenarios. POM is the fundamental unit of work in Maven. Version Control System (VCS) is a software that helps software developers to work together and maintain a complete history of their work. Two categories of VCS are:  Centralized Version Control System (CVCS)  Distributed/Decentralized Version Control System (DVCS)
  54. 54. Slide 54 of 55© People Strategists www.peoplestrategists.com Summary (Contd.) Repository is the central place where developers store all their work. Trunk is a directory where all the main development happens and is usually checked out by developers to work on the project. Branches is used to create another line of development. GIT is a distributed revision control and source code management system. Local repository is private workplace where developers make changes. Working directory is the place where files are checked out. Staging area is the place where GIT looks for the files while committing the changes to GIT repository. Pull operation copies the changes from a remote repository instance to a local one. Push operation copies changes from a local repository to a GIT repository.
  55. 55. Slide 55 of 55© People Strategists www.peoplestrategists.com Summary (Contd.) TortoiseSVN is a centralized version control system that helps to record the various version of a file. GitEye is a popular distributed version control and source code management (SCM) system. It improves GIT performance through an intuitive graphical interface that simplifies all GIT commands.

×