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
-
On GitHub, navigate to the INDI Library repository.
-
In the top-right corner of the page, click Fork.
3. Create a local clone of your fork
-
On GitHub, navigate to your fork of the INDI Library Repository.
-
Under the repository name, click Clone or download.
-
In the Clone with HTTPs section, click
to copy the clone URL for the repository.
-
Open Terminal.
-
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:
$ git clone https://github.com/YOUR-USERNAME/indi.git |
-
Press Enter. Your local clone will be created.
$ git clone https://github.com/YOUR-USERNAME/indi.git |
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.
-
On GitHub, navigate to the INDI Library repository.
-
Under the repository name, click Clone or download.
-
In the Clone with HTTPs section, click
to copy the clone URL for the repository.
-
Open Terminal.
-
Change directories to the location of the fork you cloned in Step 2: Create a local clone of your fork.
-
Type git remote -v and press Enter. You'll see the current configured remote repository for your fork.
$ git remote -v |
-
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 |
-
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 |
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.
-
Open Terminal.
-
Change the current working directory to your local project.
-
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 |
-
Check out your fork's local master branch.
$ git checkout master |
-
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 |
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
-
Follow the Setting development environment tutorial
-
When fix is done, push it to your fork on GitHub
$ git add . |
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.
-
On GitHub, navigate to the main page of the repository.
-
To the right of the Branch menu, click New pull request.
-
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.
-
Type a title and description for your pull request.
-
Click Create pull request.
After your pull request has been reviewed, it can be merged into the repository. Happy hacking!