-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Submitting a patch
The common way to contribute code to a project on GitHub is by forking it and creating a pull request after the changes are done. This is the workflow we recommend.
If you don't have a GitHub account and don't want to sign up neither, you may just create a patch file and send it to us. Follow the instructions at the very bottom of this page on how to do this.
First of all, on LINUX you need to install an 'extension' of Console
This is named git.
To get git for LINUX use this cmd in an open console in your Home-directory:
apt install git
LINUX will prompt you for your password. and install git.
You need git for the communication that is necessary with gitHub, in order to make a setup of a SSH-key.
If you have already set up a SSH key and forked our repo, first update your local copy as described below and then continue with step 2.
Follow this tutorial to generate and add SSH keys to your github account.
First, fork LMMS by clicking here. After you have done that, clone your newly created fork and configure remotes by running:
# Clone your repo into the subdirectory "lmms"
$ git clone [email protected]:yourusername/lmms.git
# Switch to new source root directory
$ cd lmms
# Add upstream repository for later updates
$ git remote add upstream git://github.com/LMMS/lmms.git
For more information on how to fork LMMS, see the GitHub help article Fork A Repo.
Having forked LMMS and cloned it to your hard drive, you can start working on the code.
You can list all changed files by running
$ git status
inside the source root directory. A more detailed view on what exactly has been changed is provided by
$ git diff
The next step is to stage the changes you've made. To stage a file, run
$ git add FILENAME
After that, you have to commit your staged changes. To do so, run
$ git commit
You'll be asked to enter a commit message to summarize what you did. Finally, push your commit:
$ git push origin
Pull requests request the admins to pull from your branch. For more help, read this github article.
You need to do these steps:
- Go to your fork's GitHub site
- Click on Pull Requests
- Hit New pull request
- Check whether the diffs make sense
- Click on Click here to create a pull request for this comparison
- Click on Send pull request
Later on, if you want to make another commit, you must first (preferably before making changes) rebase your fork on the upstream, i.e. sync it with the main LMMS repository. You can do this with the commands:
$ git fetch upstream # Fetches new changes without modifying your files
$ git rebase upstream/stable-1.0 # Replace stable-1.0 with the branch you're targeting (e.g. master)
To have your changes applied without using GitHub, create a patch file containing your changes by running
$ git diff > my-patch-for-lmms.diff
in the source root directory. Now you have a patch file we can easily apply. Just contact us about it.