This is a short guide to prospective developers who want to contribute to INDI development. It is assumed you have good C++ background as it is the language of choice in INDI.

1. Create account on Github

Before you can start contributing to INDI, you need to register an account in Github.

2. Fork the repository

  1. On GitHub, navigate to the INDI Library repository.

  2. In the top-right corner of the page, click Fork.

 

3. Create a local clone of your fork 

  1. On GitHub, navigate to your fork of the INDI Library Repository.

  2. Under the repository name, click Clone or download.

  1. In the Clone with HTTPs section, click to copy the clone URL for the repository.

  1. Open Terminal.

  2. Type git clone, and then paste the URL you copied in Step 3. It will look like this, with your GitHub username instead of YOUR-USERNAME:

  1. Press Enter. Your local clone will be created.

$ git clone https://github.com/YOUR-USERNAME/indi.git
Clonage dans 'indi'...
remote: Counting objects: 42279, done.
remote: Total 42279 (delta 0), reused 0 (delta 0), pack-reused 42279
Réception d'objets: 100% (42279/42279), 167.41 MiB | 795.00 KiB/s, fait.
Résolution des deltas: 100% (32317/32317), fait.
Vérification de la connectivité... fait.

Now, you have a local copy of your fork of the INDI Library Repository !

4. Setup your fork upstream repository

When you fork a project in order to propose changes to the original repository, you can configure Git to pull changes from the original, or upstream, repository into the local clone of your fork.

 

  1. On GitHub, navigate to the INDI Library repository.

  2. Under the repository name, click Clone or download.

  1. In the Clone with HTTPs section, click to copy the clone URL for the repository.

  1. Open Terminal.

  2. Change directories to the location of the fork you cloned in Step 2: Create a local clone of your fork.

  3. Type git remote -v and press Enter. You'll see the current configured remote repository for your fork.

$ git remote -v
origin https://github.com/YOUR-USERNAME/indi.git (fetch)
origin https://github.com/YOUR-USERNAME/indi.git (push)
  1. Type git remote add upstream, and then paste the URL you copied in Step 3 and press Enter. It will look like this:

 $ git remote add upstream https://github.com/indilib/indi.git
  1. To verify the new upstream repository you've specified for your fork, type git remote -v again. You should see the URL for your fork as origin, and the URL for the original repository as upstream.

$ git remote -v
origin https://github.com/YOUR-USERNAME/indi.git (fetch)
origin https://github.com/YOUR-USERNAME/indi.git (push)
upstream https://github.com/indilib/indi.git (fetch)
upstream https://github.com/indilib/indi.git (push)

5. Syncing your fork

Sync your local fork to keep it up-to-date with the upstream primary INDI repository. Since the INDI primary repository is under continuous development and can be updated at any time, you must always make sure to keep your local fork up to date with the primary INDI repo.

  1. Open Terminal.

  2. Change the current working directory to your local project.

  3. Fetch the branches and their respective commits from the upstream repository. Commits to master will be stored in a local branch, upstream/master.

$ git fetch upstream
remote: Counting objects: 23, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 23 (delta 17), reused 22 (delta 17), pack-reused 0
Dépaquetage des objets: 100% (23/23), fait.
Depuis https://github.com/indilib/indi
39ffa64..06986a1  master -> upstream/master
  1. Check out your fork's local master branch.

$ git checkout master
Switched to branch 'master'
  1. Merge the changes from upstream/master into your local master branch. This brings your fork's master branch into sync with the upstream repository, without losing your local changes.

$ git merge upstream/master
Updating a422352..5fdff0f
Fast-forward
README                    | 9 -------
README.md                 | 7 ++++++
2 files changed, 7 insertions(+), 9 deletions(-)
delete mode 100644 README
create mode 100644 README.md

Syncing your fork only updates your local copy of the repository. To update your fork on GitHub, you must push your changes.

6. Make the fix / Add new features 

  1. Follow the Setting development environment tutorial

  2. When fix is done, push it to your fork on GitHub

$ git add .
$ git commit -m "YOUR COMMENT"
$ git push

7. Submit a pull request to primary INDI repo

Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before the changes are merged into the repository. 

  1. On GitHub, navigate to the main page of the repository.

  2. To the right of the Branch menu, click New pull request.

  1. Use the base branch dropdown menu to select the branch you'd like to merge your changes into, then use the compare branch drop-down menu to choose the topic branch you made your changes in.

  1. Type a title and description for your pull request.

  1. Click Create pull request.

After your pull request has been reviewed, it can be merged into the repository. Happy hacking!