OMFIT + git/GitHub
Setup your SSH keys on GitHub
This needs to be done only once, whether you use the gafusion repository or your own fork
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:
In OMFIT preferences, set your GITHUB username accordingly.
This will allow you to easily access your own fork from within OMFIT.
Importing modules
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”
Exporting modules
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:
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.
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
GitHub
Repo
Working repo
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
GitHub
Repo
Working repo
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
Exporting modules
What is happening underneath
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
A
A
import
B
export
module
X
‘AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA’
other contributions
Module in the OMFIT tree
A
A
import
B
X
W
merge
pull
‘AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA’
Module in the OMFIT tree
export
module
A
A
import
B
X
W
W
merge
pull
push
‘AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA’
Module in the OMFIT tree
export
module
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
A
A
import
B
X
W
‘BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB’
Module in the OMFIT tree
Base commit
A
A
import
B
X
W
‘BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB’
C
Y
Module in the OMFIT tree
export
module
A
A
import
B
X
W
C
‘BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB’
Y
Z
merge
pull
Module in the OMFIT tree
export
module
A
A
import
B
X
W
C
‘BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB’
Y
Z
Z
merge
pull
push
Module in the OMFIT tree
export
module
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