Cloning Git Repository

From Gcube Wiki
Jump to: navigation, search

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.