-
Notifications
You must be signed in to change notification settings - Fork 172
How to contribute code using Github
This page describes how you can contribute code to the Hydrogen project using Github The page is mainly aimed at Linux users, but should contain enough info for Mac and Windows users
- Goto https://github.com/hydrogen-music/hydrogen
- Click the 'fork' button (upper right) :
- Select your github account to fork to and wait
- Now you have created a clone of the Hydrogen repo in your Github repo that can be accessed via https://github.com/yourname/hydrogen
- On your github repo page you will see a 'Clone or download' button, click it and you will see the 'Clone with SSH' box :
- Copy the URL using the clipboard icon next to it
- On your pc create a directory that will hold your local repo
- Open a terminal and cd to the directory you just created
- Now enter 'git clone' and paste the URL you copied above. This should look like this : 'git clone [email protected]:yourname/hydrogen.git' :
$ git clone [email protected]:yourname/hydrogen.git
Cloning into 'hydrogen'...
remote: Counting objects: 28218, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 28218 (delta 8), reused 0 (delta 0), pack-reused 28202
Receiving objects: 100% (28218/28218), 15.39 MiB | 2.94 MiB/s, done.
Resolving deltas: 100% (19189/19189), done.
- Cd to the new Hydrogen subdir that was created and check the git status with 'git status' :
me@mypc:~/Git/Hydrogen/yourname$ cd hydrogen
me@mypc:~/Git/Hydrogen/yourname/hydrogen$ git status
# On branch master
nothing to commit (working directory clean)
- Now tell Git your email and name :
me@mypc:~/Git/Hydrogen/yourname/hydrogen$git config --global user.email "[email protected]"
me@mypc:~/Git/Hydrogen/yourname/hydrogen$git config --global user.name "Thijs Van Severen"
... and you are all set !
4) Build Hydrogen (see this wiki page)
- Use the 'git status' command to see what files have been modified :
me@mypc:~/Git/Hydrogen/yourname/hydrogen$ git status
# On branch master
# Your branch is behind 'origin/master' by 1 commits, and can be fast-forwarded.
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: src/gui/src/SongEditor/SongEditorPanelTagWidget_UI.ui
#
no changes added to commit (use "git add" and/or "git commit -a")
- First you have to add these files to your local repo using 'git add' :
me@mypc:~/Git/Hydrogen/yourname/hydrogen$ git add src/gui/src/SongEditor/SongEditorPanelTagWidget_UI.ui
- Lets check the git status again using 'git status' :
me@mypc:~/Git/Hydrogen/yourname/hydrogen$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: src/gui/src/SongEditor/SongEditorPanelTagWidget_UI.ui
#
As you can see the file has been added to the repo but this addition still needs to be committed with the 'git commit -m "my comment"' command :
me@mypc:~/Git/Hydrogen/yourname/hydrogen$ git commit -m "set the tag column header to stretch over the whole window"
[master 625945a] set the tag column header to stretch over the whole window
Committer: yourname <yourname@yourpc.(none)>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email [email protected]
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
8) Push the changes from your local repo (on your PC) to your remote github repo (on the Github server) using 'git push'
me@mypc:~/Git/Hydrogen/yourname/hydrogen$ git push
Counting objects: 13, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 713 bytes, done.
Total 7 (delta 5), reused 0 (delta 0)
To [email protected]:yourname/hydrogen.git
71e9ed5..625945a master -> master
- Goto your github account (https://github.com/yourname/hydrogen)
- On the repositories tab click the Hydrogen repo
- On the commits tab you should now see your commit :
Your code has now been uploaded to your personal Github repo, but it has not been merged into the main Hydrogen repo yet. To do this you need to make a 'pull request'.
A pull request is basically asking the Hydrogen Github repo responsible to have a look at the code you created (or modified) and (if your work looks good) merge it into the Hydrogen repo.
At this point it is very likely that you will be asked for some more info, or to make some modifications to your code. Please don't be offended by this : this is the only way that we can guarantee a high quality application. We will always tell you why your code needs to be modified and help you with all your questions.
- Go to your main github page (https://github.com/yourname/hydrogen)
- Click the 'Compare & review' button :
- You are now presented with the following screen :
- Note that the 'base fork' (the original Hydrogen repo) and 'head fork' (your repo) are automatically filled in (but you can manually change this if needed)
- Also note that github has already checked if the 2 branches can be merged
- Now click the 'create pull request' button and enter some info about this pull request (more info = better)
- Click the 'Create pull request' button and your pull request will be submitted to the maintainers of the main Hydrogen repo.
Your pull request will now be listed on the pull request pqge of the Hydrogen repo
Once your pull request is accepted your code will be merged in to the main Hydrogen repo and your pull request will be updated :