-
Notifications
You must be signed in to change notification settings - Fork 172
How to contribute code using Github
thijs edited this page Oct 20, 2015
·
60 revisions
This page describes how you can contribute code to the Hydrogen project using Github
- goto github.com
- create a Gihub account
- upload your public key ``for SSH access
- clone the hydrogen repo :
- goto https://github.com/hydrogen-music/hydrogen
- click the 'fork' button (upper right) :
- 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
- clone the code from your Github repo to your PC
-
on your github repo page you will see a 'SSH clone URL' 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 [email protected]:thijz/hydrogen.git' :
$ git clone [email protected]:thijz/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/thijz$ cd hydrogen
me@mypc:~/Git/Hydrogen/thijz/hydrogen$ git status
# On branch master
nothing to commit (working directory clean)
-
build hydrogen (see this wiki page)
-
fix a bug or create your own new Hydrogen feature
-
build hydrogen and test your new feature
-
commit your changes
- using the 'git status' command you can see what files have been modified :
me@mypc:~/Git/Hydrogen/thijz/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 will have to add these files to your local repo using 'git add' :
me@mypc:~/Git/Hydrogen/thijz/hydrogen$ git add src/gui/src/SongEditor/SongEditorPanelTagWidget_UI.ui
- now lets check the git status again using 'git status' :
me@mypc:~/Git/Hydrogen/thijz/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/thijz/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: tvanseve <tvanseve@tvanseve-ThinkPad-W530.(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
- 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/thijz/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]:thijz/hydrogen.git
71e9ed5..625945a master -> master