| ... | ... | @@ -5,6 +5,7 @@ title: Pushing MAR code changes from a cluster or lab machine |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This tutorial describes how you can commit and push MAR code changes on a GitLab repository (such as [ESPECES/MAR/stable](https://gitlab.uliege.be/especes/mar/stable)) from a cluster or lab machine (such as climato.be) using a few ``git`` commands.
|
|
|
|
|
|
|
|
>**Reminders about ``git`` terminology:**
|
| ... | ... | @@ -45,12 +46,12 @@ The first two steps above only need to be done once. Only the third and final st |
|
|
|
|
|
|
|
1. From any location on your lab machine (e.g., climato.be) or cluster, run the following commands to add your GitLab username and associated email address. The keyword ``--global`` ensures that this information can be used for all repositories.
|
|
|
|
```
|
|
|
|
git config --global user.name ‘JefGrailet’
|
|
|
|
git config --global user.email ‘Jean-Francois.Grailet@uliege.be’
|
|
|
|
git config --global user.name "JefGrailet"
|
|
|
|
git config --global user.email "Jean-Francois.Grailet@uliege.be"
|
|
|
|
```
|
|
|
|
2. Run the following command, which tells ``git`` that your GitLab credentials will be stored in a document `~/.uliege-gitlab-credentials` for any repository (via ``--global``). If in doubt, you can use ``cat ~/.gitconfig`` to check that the file is listed under a _credential_ section.
|
|
|
|
```
|
|
|
|
git config --global credential.helper “store --file ~/.uliege-gitlab-credentials”
|
|
|
|
git config --global credential.helper "store --file ~/.uliege-gitlab-credentials"
|
|
|
|
```
|
|
|
|
3. Using ``vim`` or ``gedit``, create the document `~/.uliege-gitlab-credentials` and write the following sequence, replacing `[login]` with your GitLab username and `[token]` with the token created in the [previous section](mar-push#step-1-create-an-access-token-on-gitlab-only-once). Save and exit the editor.
|
|
|
|
```
|
| ... | ... | @@ -71,7 +72,7 @@ git add src/forMAR/forMAR/* |
|
|
|
```
|
|
|
|
2. Record a commit with a message describing the change, as shown below. As a check before the push (next step), the terminal will display all the changed files with the number of changes made. Check that everything has been correctly recorded in the list of changes.
|
|
|
|
```
|
|
|
|
git commit -m ‘Added Black Sea params to marmagic_mod.f90’
|
|
|
|
git commit -m "Added Black Sea params to marmagic_mod.f90"
|
|
|
|
```
|
|
|
|
3. Do the push, which will actually upload the changes to the GitLab repository.
|
|
|
|
```
|
| ... | ... | |
| ... | ... | |