1 of 22

OMFIT + git/GitHub

2 of 22

Setup your SSH keys on GitHub

This needs to be done only once, whether you use the gafusion repository or your own fork

3 of 22

Setup GIT

to make sure that your ssh keys are properly setup on the system where OMFIT is running use: ssh git@github.com

git config --global user.name "YOUR NAME"�git config --global user.email YOUREMAIL@EMAIL.COM�git config --global color.ui auto

Setup your GIT environment where OMFIT is running:

4 of 22

In OMFIT preferences, set your GITHUB username accordingly.

This will allow you to easily access your own fork from within OMFIT.

5 of 22

Importing modules

6 of 22

Modules can be imported from a remote/branch

If these are left blank then OMFIT will import modules as they are in the “Repository directory”

7 of 22

Exporting modules

8 of 22

Users can contribute to OMFIT modules’ development by pushing their changes to the OMFIT-source GitHub repository directly from within OMFIT. This feature is aimed at lowering the effort for new users to contribute to the OMFIT physics modules. This is handled within git and the OMFIT GUI as follows:

where:

  • remote/branch are the git remote and branch to which the changes will be pushed

To add a remote, just type it in the `Remote` entry. To create a new branch, just type it in the `Branch` entry.

Please note that unless the remote and branch are left empty, OMFIT makes a clone of the original repository so that it can freely operate on it, without affecting the original repository (making the clone is not instantaneous). The remote named original_git_repository of the cloned repo points to the original git repository.

9 of 22

Repo

remote = ‘’

branch = ‘’

If remote and branch are blank, then git is not invoked and the module is exported in the designated modules directory.

It is up to the user to handle committing the changes and pushing the updates to GitHub

10 of 22

GitHub

Repo

Working repo

  1. clone

3. push

remote/branch

2. base

remote/branch

remote = ‘orso82’

branch = ‘test’

remote: original_git_repository

Remote and branch indicate on which remote/branch to push the changes that have been made

11 of 22

GitHub

Repo

Working repo

  • clone

3. push

remote/branch

2. base

remote/branch

remote = ‘original_git_repository’

branch = ‘test’

remote: original_git_repository

To perform a commit on the local repository, use `original_git_repository` as the remote. It will be then up to the user to sync the changes on GitHub

12 of 22

Exporting modules

What is happening underneath

13 of 22

A

A

import

‘AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA’

root[‘SETTINGS’][‘MODULE’][‘commit’]

is initialized when importing a module to the last commit of the repository where that module was modified.

Module in the OMFIT tree

Base commit

When exporting something OMFIT will make the diff with respect to the commit that is specified under

root[‘SETTINGS’][‘MODULE’][‘commit’]

This is what we refer to as the base commit

14 of 22

A

A

import

B

export

module

X

‘AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA’

other contributions

Module in the OMFIT tree

15 of 22

A

A

import

B

X

W

merge

pull

‘AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA’

Module in the OMFIT tree

export

module

16 of 22

A

A

import

B

X

W

W

merge

pull

push

‘AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA’

Module in the OMFIT tree

export

module

17 of 22

A

A

import

B

X

W

W

merge

pull

push

‘BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB’

Note that the commit registered in the module loaded in the OMFIT tree is B, and not W. This is because W is not what is in the OMFIT tree (since there was no merge of X in the OMFIT tree).

However, since W includes the content of B, including handling of merge conflicts, we will not be asked to re-handle the same conflicts for the next export of the module.

After exporting, the base commit stored in root[‘SETTINGS’][‘MODULE’][‘commit’] is updated to point to the commit B, after the export, and before the merge.

Module in the OMFIT tree

export

module

18 of 22

A

A

import

B

X

W

‘BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB’

Module in the OMFIT tree

Base commit

19 of 22

A

A

import

B

X

W

‘BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB’

C

Y

Module in the OMFIT tree

export

module

20 of 22

A

A

import

B

X

W

C

‘BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB’

Y

Z

merge

pull

Module in the OMFIT tree

export

module

21 of 22

A

A

import

B

X

W

C

‘BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB’

Y

Z

Z

merge

pull

push

Module in the OMFIT tree

export

module

22 of 22

A

A

import

B

X

W

C

‘CCCCCCCCCCCCCCCCCCCCCCCCCCCCC’

Y

Z

Z

merge

pull

push

Again, commit Z includes content of C including handling of merge conflicts.

The base commit stored in root[‘SETTINGS’][‘MODULE’][‘commit’] is updated to point to the commit C, after the export, and before the merge.

Module in the OMFIT tree

export

module