Difference between revisions of "Cloning Git Repository"
From Gcube Wiki
Manuele.simi (Talk | contribs) (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...") |
(No difference)
|
Revision as of 22:26, 16 January 2020
Contents
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"
Change the SCM Connection
The SCM section of the POM must be changed to reflect that we are now working with a Git repository.
For instance, the following section:
<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>
must be changed to:
<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 must declare the Git repository URL like is it:
<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.