Difference between revisions of "Cloning Git Repository"

From Gcube Wiki
Jump to: navigation, search
(Created page with " = Clone the repository and create a working copy = Change dir to a selected (or workspace) folder and clone the new Git repository: <source lang="bash"> > cd ~/Work/CNR/Proje...")
 
(Change the SCM Connection)
 
Line 29: Line 29:
 
</source>
 
</source>
  
= Change the SCM Connection =
+
= Set up the SCM Connection =
The SCM section of the POM must be changed to reflect that we are now working with a Git repository.
+
The SCM section of the POM must refer the a Git repository as follows:
 
+
For instance, the following section:
+
<pre>
+
  <scm>
+
<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/distributions/${project.artifactId}</connection>
+
<developerConnection>scm:svn:https://svn.d4science.research-infrastructures.eu/gcube/trunk/distributions/${project.artifactId}</developerConnection>
+
<url>http://svn.d4science.research-infrastructures.eu/gcube/trunk/distributions/${project.artifactId}</url>
+
  </scm>
+
</pre>
+
 
+
must be changed to:
+
  
 
<pre>
 
<pre>
Line 53: Line 42:
 
'''NB'''. In this case, the ${project.artifactId} declared in the pom is equal to the repository name declared on Git.  
 
'''NB'''. In this case, the ${project.artifactId} declared in the pom is equal to the repository name declared on Git.  
  
Otherwise, you must declare the Git repository URL like is it:
+
Otherwise, you can set the YOUR_GIT_REPOSITORY_URL variable and declare the Git repository URL as:
  
 
<pre>
 
<pre>

Latest revision as of 21:28, 16 January 2020

Clone the repository and create a working copy

Change dir to a selected (or workspace) folder and clone the new Git repository:

> cd ~/Work/CNR/Projects/Git/
> git clone https://code-repo.d4science.org/manuele.simi/gxRest.git
Cloning into 'gxRest'...
remote: Counting objects: 168, done.
remote: Compressing objects: 100% (81/81), done.
remote: Total 168 (delta 44), reused 168 (delta 44)
Receiving objects: 100% (168/168), 39.47 KiB | 0 bytes/s, done.
Resolving deltas: 100% (44/44), done.

Configure authors info

Single repo configuration

In the root folder of the repository:

> git config user.email "manuele.simi@isti.cnr.it"
> git config user.name "Manuele Simi"

Global configuration (all repos on this computer)

In any folder:

> git config --global user.email "manuele.simi@isti.cnr.it"
> git config --global user.name "Manuele Simi"

Set up the SCM Connection

The SCM section of the POM must refer the a Git repository as follows:

<scm>
    <connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection>
    <developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection>
    <url>https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</url>
</scm>

NB. In this case, the ${project.artifactId} declared in the pom is equal to the repository name declared on Git.

Otherwise, you can set the YOUR_GIT_REPOSITORY_URL variable and declare the Git repository URL as:

<scm>
    <connection>scm:git:[YOUR_GIT_REPOSITORY_URL].git</connection>
    <developerConnection>scm:git:[YOUR_GIT_REPOSITORY_URL].git</developerConnection>
    <url>[YOUR_GIT_REPOSITORY_URL]</url>
</scm>

Back to the CI guide.