SlideShare a Scribd company logo
Enviar pesquisa
Carregar
Entrar
Cadastre-se
Exploring Maven SVN GIT
Denunciar
People Strategists
Seguir
People Strategists
31 de Jul de 2015
•
0 gostou
•
1,456 visualizações
1
de
55
Exploring Maven SVN GIT
31 de Jul de 2015
•
0 gostou
•
1,456 visualizações
Baixar agora
Baixar para ler offline
Denunciar
Tecnologia
MS
People Strategists
Seguir
People Strategists
Recomendados
Working with Servlets
People Strategists
741 visualizações
•
30 slides
Spring Framework -I
People Strategists
1.5K visualizações
•
49 slides
Struts Introduction Course
guest764934
1.7K visualizações
•
77 slides
TY.BSc.IT Java QB U3
Lokesh Singrol
139 visualizações
•
8 slides
Struts notes
Rajeev Uppala
3.1K visualizações
•
130 slides
Spring framework in depth
Vinay Kumar
5.1K visualizações
•
63 slides
Mais conteúdo relacionado
Mais procurados
TY.BSc.IT Java QB U4
Lokesh Singrol
173 visualizações
•
7 slides
Spring Core
Pushan Bhattacharya
7.2K visualizações
•
48 slides
Struts course material
Vibrant Technologies & Computers
368 visualizações
•
18 slides
Annotation-Based Spring Portlet MVC
John Lewis
5.1K visualizações
•
17 slides
TY.BSc.IT Java QB U6
Lokesh Singrol
364 visualizações
•
9 slides
Ee java lab assignment 4
Kuntal Bhowmick
11 visualizações
•
1 slide
Mais procurados
(20)
TY.BSc.IT Java QB U4
Lokesh Singrol
•
173 visualizações
Spring Core
Pushan Bhattacharya
•
7.2K visualizações
Struts course material
Vibrant Technologies & Computers
•
368 visualizações
Annotation-Based Spring Portlet MVC
John Lewis
•
5.1K visualizações
TY.BSc.IT Java QB U6
Lokesh Singrol
•
364 visualizações
Ee java lab assignment 4
Kuntal Bhowmick
•
11 visualizações
Spring andspringboot training
Mallikarjuna G D
•
338 visualizações
TY.BSc.IT Java QB U5&6
Lokesh Singrol
•
360 visualizações
Struts,Jsp,Servlet
dasguptahirak
•
7.6K visualizações
Struts notes
dssreenath
•
12.4K visualizações
Spring IOC advantages and developing spring application sample
Sunil kumar Mohanty
•
3.7K visualizações
Spring aop
Hamid Ghorbani
•
341 visualizações
Struts An Open-source Architecture for Web Applications
elliando dias
•
1.4K visualizações
Servlets lecture1
Tata Consultancy Services
•
2K visualizações
Introduction to Spring's Dependency Injection
Richard Paul
•
4K visualizações
TY.BSc.IT Java QB U5
Lokesh Singrol
•
164 visualizações
Introduction to Spring Boot
Purbarun Chakrabarti
•
832 visualizações
Next stop: Spring 4
Oleg Tsal-Tsalko
•
12K visualizações
Spring mvc
Hamid Ghorbani
•
857 visualizações
Glassfish JEE Server Administration - JEE Introduction
Danairat Thanabodithammachari
•
1.2K visualizações
Similar a Exploring Maven SVN GIT
Maven 2 features
Angel Ruiz
4.4K visualizações
•
33 slides
Apache maven, a software project management tool
Renato Primavera
1.6K visualizações
•
57 slides
Introduction to maven, its configuration, lifecycle and relationship to JS world
Dmitry Bakaleinik
682 visualizações
•
91 slides
Maven 2.0 - Project management and comprehension tool
elliando dias
2K visualizações
•
44 slides
Maven Introduction
Sandeep Chawla
20.8K visualizações
•
31 slides
Maven basics
Vijay Krishnan Ramaswamy
252 visualizações
•
25 slides
Similar a Exploring Maven SVN GIT
(20)
Maven 2 features
Angel Ruiz
•
4.4K visualizações
Apache maven, a software project management tool
Renato Primavera
•
1.6K visualizações
Introduction to maven, its configuration, lifecycle and relationship to JS world
Dmitry Bakaleinik
•
682 visualizações
Maven 2.0 - Project management and comprehension tool
elliando dias
•
2K visualizações
Maven Introduction
Sandeep Chawla
•
20.8K visualizações
Maven basics
Vijay Krishnan Ramaswamy
•
252 visualizações
Jbossworld Presentation
Dan Hinojosa
•
446 visualizações
Java, Eclipse, Maven & JSF tutorial
Raghavan Mohan
•
2K visualizações
Maven with Flex
Priyank
•
1.1K visualizações
Maven with Flex
Priyank
•
518 visualizações
Maven in mulesoft
venkata20k
•
141 visualizações
Maven: Managing Software Projects for Repeatable Results
Steve Keener
•
706 visualizações
Maven
Shraddha
•
416 visualizações
Intelligent Projects with Maven - DevFest Istanbul
Mert Çalışkan
•
1.3K visualizações
Liferay maven sdk
Mika Koivisto
•
3.2K visualizações
Build server
Christophe Vanlancker
•
93 visualizações
An Introduction to Maven and Flex
Justin J. Moses
•
2.7K visualizações
Maven
Fabio Bonfante
•
827 visualizações
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
chrisb206 chrisb206
•
1.9K visualizações
Using Maven 2
andyhot
•
2.8K visualizações
Mais de People Strategists
MongoDB Session 3
People Strategists
924 visualizações
•
17 slides
MongoDB Session 2
People Strategists
560 visualizações
•
24 slides
MongoDB Session 1
People Strategists
580 visualizações
•
21 slides
Android - Day 1
People Strategists
632 visualizações
•
57 slides
Android - Day 2
People Strategists
580 visualizações
•
19 slides
Overview of web services
People Strategists
3.5K visualizações
•
62 slides
Mais de People Strategists
(20)
MongoDB Session 3
People Strategists
•
924 visualizações
MongoDB Session 2
People Strategists
•
560 visualizações
MongoDB Session 1
People Strategists
•
580 visualizações
Android - Day 1
People Strategists
•
632 visualizações
Android - Day 2
People Strategists
•
580 visualizações
Overview of web services
People Strategists
•
3.5K visualizações
Spring Framework - III
People Strategists
•
1.2K visualizações
Spring Framework-II
People Strategists
•
1.3K visualizações
Hibernate II
People Strategists
•
923 visualizações
Hibernate III
People Strategists
•
1.1K visualizações
Hibernate I
People Strategists
•
2.4K visualizações
Identifing Listeners and Filters
People Strategists
•
1.1K visualizações
Agile Dev. II
People Strategists
•
883 visualizações
Agile Dev. I
People Strategists
•
757 visualizações
Overview of JEE Technology
People Strategists
•
1.3K visualizações
JSP Technology II
People Strategists
•
892 visualizações
JSP Technology I
People Strategists
•
1.7K visualizações
XML Schemas
People Strategists
•
2.1K visualizações
JSON and XML
People Strategists
•
3.4K visualizações
Ajax and Jquery
People Strategists
•
3.7K visualizações
Último
Enhance Productivity Expert Laptop Support For Modern Professional
IT Services Helps
15 visualizações
•
11 slides
Accelerating Data Science through Feature Platform, Transformers, and GenAI
FeatureByte
133 visualizações
•
46 slides
LLaMA 2.pptx
RkRahul16
15 visualizações
•
19 slides
Experts Live Europe 2023 - Ensure your compliance in Microsoft Teams with Mic...
Jasper Oosterveld
54 visualizações
•
76 slides
Understanding Wireguard, TLS and Workload Identity
Christian Posta
96 visualizações
•
51 slides
Enterprise Application and Data Protection on AWS with Amazon FSx for NetApp ...
LilyJang3
17 visualizações
•
43 slides
Último
(20)
Enhance Productivity Expert Laptop Support For Modern Professional
IT Services Helps
•
15 visualizações
Accelerating Data Science through Feature Platform, Transformers, and GenAI
FeatureByte
•
133 visualizações
LLaMA 2.pptx
RkRahul16
•
15 visualizações
Experts Live Europe 2023 - Ensure your compliance in Microsoft Teams with Mic...
Jasper Oosterveld
•
54 visualizações
Understanding Wireguard, TLS and Workload Identity
Christian Posta
•
96 visualizações
Enterprise Application and Data Protection on AWS with Amazon FSx for NetApp ...
LilyJang3
•
17 visualizações
BuilderAI Proposal_Malesniak
Michael Lesniak
•
84 visualizações
Metadata & Discovery Group Conference 2023 - Day 2
CILIP MDG
•
12 visualizações
Swiss Re Reinsurance Solutions - Automated Claims Experience – Insurer Innova...
The Digital Insurer
•
29 visualizações
Improving Employee Experiences on Cisco RoomOS Devices, Webex, and Microsoft ...
ThousandEyes
•
60 visualizações
The Ultimate Administrator’s Guide to HCL Nomad Web
panagenda
•
50 visualizações
Metadata & Discovery Group Conference 2023 - Day 1 Programme
CILIP MDG
•
23 visualizações
Scaling out with WordPress
Konstantin Kovshenin
•
54 visualizações
Elevate Your Enterprise with FME 23.1
Safe Software
•
271 visualizações
Announcing InfluxDB Clustered
InfluxData
•
51 visualizações
Easy Salesforce CI/CD with Open Source Only - Dreamforce 23
NicolasVuillamy1
•
155 visualizações
h2 meet pdf test.pdf
JohnLee971654
•
51 visualizações
How to Manage Your Offshore Software Development Team Efficiently
Capital Numbers
•
28 visualizações
How to use the Cataloguing Code Ethics at your day job : a hands-on workshop ...
CILIP MDG
•
30 visualizações
ISO Survey 2022: ISO 27001 certificates (ISMS)
Andrey Prozorov, CISM, CIPP/E, CDPSE. LA 27001
•
73 visualizações
Exploring Maven SVN GIT
1.
Slide 1 of
55© People Strategists www.peoplestrategists.com Exploring Maven, SVN and GIT
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.
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.
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.
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.
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.
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.
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.
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.
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.
Slide 11 of
55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Two types of the POM are: Minimal POM Super POM
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.