Github makes it easy to contribute to the DiFX codebase. For frequent contributors, it is probably desirable to join the DiFX project - you can do this by subscribing to the difx-developers mailing list hosted at https://listmgr.nrao.edu/mailman/listinfo/difx-developers and asking to be added to the project. This will enable you to create branches directly on the main DiFX github project.
While we strongly encourage people to join the project directly, it is also possible to fork DiFX on Github and then create branches in your own project. You can do this by cloning a copy of the DiFX repository to your own computer, or alternatively using Codespaces, a cloud-based in-brower development environment that comes with the appropriated setup to contribute to DiFX.
In either case, once you have implemented and tested a new feature, it can be merged back into the main DiFX codebase by submitting a "pull request". A brief overview of the workflow is as following:
Initial steps to get a working DiFX installation:
- For occasional contributors not part of the main DiFX project only: Create an account on Github if you do not have one yet.
- For occasional contributors not part of the main DiFX project only: Fork the DiFX on Github by clicking on the Fork button near the top of the page. This creates a copy of the code under your account on the GitHub server.
- Set up a development environment:
- If you forked DiFX:
git clone https://github.com/<your github usename>/difx.git
Otherwise:git clone https://github.com/difx/difx.git
- If you forked DiFX:
- Follow the installation of DiFX.
Then each time you want to make a contribution: 5. Create a branch to hold your changes, and start making changes. Never work in the 'main' branch!!
git checkout -b feature-xxx origin/main
based on main branch orgit checkout -b feature-xxx origin/dev
based on dev branch- Work on this task using Git to do the version control, push them to github using:
git add file_changed
git commit -m 'messges'
git push -u origin feature-xxx
- Finally, go to the github page of the project you are working under (the main DiFX project for regular contributors, or your own project if you forked it), and click 'Pull request' to send your changes to the maintainers for review.
- You probably then want to delete your feauture branch once the pull request is approved (which can be done on the command line or on github)