... | ... | @@ -27,7 +27,15 @@ $ git clone --recurse-submodules git@gitlab.psi.ch:OPAL/Libraries/ippl.git |
|
|
```
|
|
|
|
|
|
### Working with a fork
|
|
|
For larger projects we recommend to fork the main repository. In order to obtain the latest changes from the upstream, you should add the master by
|
|
|
For larger projects we recommend to fork the main repository. You can also fork a certain submodule only.
|
|
|
|
|
|
To fork a submodule, you can do so via the GitLab interface. Then, replace the url of the submodule by the url of your fork in the file [.gitmodules] (https://gitlab.psi.ch/OPAL/Libraries/ippl/-/blob/master/.gitmodules). Once this is done:
|
|
|
```bash
|
|
|
$ git submodule init
|
|
|
$ git submodule update
|
|
|
```
|
|
|
|
|
|
You can add an upstream to be able to get all the latest changes from the master. If you are working with a fork of the main repository, for example, you can add the upstream by:
|
|
|
```bash
|
|
|
$ git remote add upstream git@gitlab.psi.ch:OPAL/Libraries/ippl.git
|
|
|
```
|
... | ... | @@ -35,5 +43,9 @@ You can then easily pull by typing |
|
|
```bash
|
|
|
$ git pull upstream/master
|
|
|
````
|
|
|
If you want to fork a submodule, its upstream is added similarly. However, you need to update the url of the
|
|
|
appropriate module in the file [.gitmodules](https://gitlab.psi.ch/OPAL/Libraries/ippl/-/blob/master/.gitmodules) with your fork url in order to compile IPPL. If you do so, you do not need to checkout the submodule separately. You can directly push and pull from the subdirectory which represents the root of the submodule repository. |
|
|
This can also be done with forks of submodules, just go to the directory of the submodule in your cloned repository, and then repeat the commands above with the main repository address replaced by the submodule address. For example, for the Ippl-solvers submodule:
|
|
|
```bash
|
|
|
$ git remote add upstream git@gitlab.psi.ch:OPAL/Libraries/ippl-solvers.git
|
|
|
```
|
|
|
|
|
|
You can directly push and pull from the subdirectory which represents the root of the submodule repository. |