-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Get MuseScore's source code
You must have Git installed on your computer. See Set up Developer Environment.
Create a folder called src to store source code projects on your machine.
Tips for creating the src folder
|
Windows
Create your src folder at the root of an NTFS-formatted drive, such as your C: drive:
# Change to the C: drive's root directory:
cd C:\ # PowerShell or CMD
cd /c # Git Bash
# Create a new directory for code projects:
mkdir srcIt must go near the root of the drive to avoid encountering the 260 character MAX_PATH limit Windows places on the length of file paths. (Code projects like MuseScore often contain files with long names and many layers of subdirectories, particularly inside the build folder.)
Linux and macOS
Normally, it's best to create your src folder inside your Home directory:
cd ~ # Change to your Home directory.
pwd # Print its full path. (See below to check it's OK.)
mkdir src # If the path is OK, create a new directory for source projects.However, paths with unusual characters can cause problems when you try to compile or run terminal commands.
/home/Francois-Pierre42 ✔️ OK
/Users/Francois_Pierre42 ✔️ OK
/@home/Francois+Pierre ❔ Contains special characters ('@', '+') but probably still OK.
/home/Francois Pierre ❌ BAD: Contains space.
/Users/FrançoisPierre ❌ BAD: Contains non-ASCII character 'ç'.
If that affects you, move the src folder elsewhere and run sudo chown -R "${USER}" src to make yourself the owner. (Next time you set up a user account, try to use only ASCII letters, numbers, hyphen, and underscore in the Home path.)
A 'fork' is a remote (i.e. online) copy of a repository. It can be edited freely without affecting the original repository.
Tip: Only create a fork if you want to edit the code. If you just want to compile then you can skip creating the fork and move straight to Clone the repository.
To create a fork:
- Sign-in to GitHub (create a free account if necessary).
- Visit MuseScore's official repository page: https://github.com/musescore/MuseScore
- Click the "Fork" button in the top right to create your personal fork.
Your fork exists at https://github.com/USERNAME/MuseScore where USERNAME is your GitHub username (e.g. shoogle's fork is here).
A clone is a local (i.e. offline) copy of a repository. It's basically a folder on your computer that contains the code for you to edit and/or compile.
If you made a fork then you should clone it here, otherwise clone the official repository. Make the clone inside your src folder.
# Go to your src folder. For example:
cd ~/src # Linux and macOS
cd C:\src # Windows - PowerShell or CMD
cd /c/src # Windows - Git Bash
# Clone your fork if you have one:
git clone https://github.com/USERNAME/MuseScore # Replace USERNAME with your GitHub username.
# Otherwise clone the official repo:
git clone https://github.com/musescore/MuseScoreTip: If you have a fork and you're on Linux or macOS, consider using its SSH URL git@github.com:USERNAME/MuseScore.git instead of the HTTPS URL with the git clone command. This requires additional setup, but it means that you don't have to enter your password every time you push code changes to GitHub. On Windows it's better to use the HTTPS URL if you want the password to be remembered.
The git clone command put the code in a new folder called "MuseScore". You should change to it now:
cd MuseScoreThis folder is used as the working directory for all subsequent commands, including on subsequent pages of this guide.
Git is able to push (upload code to) and pull (download code from) remote repositories, known as "remotes".
Run these commands to set the remotes for your local repository:
# If you cloned your fork earlier:
git remote add upstream https://github.com/musescore/MuseScore.git
git remote set-url upstream --push disabled # Prevent accidental push to official repo (team members only)
git pull upstream master # Get latest code from official repo.
git branch -u upstream/master # Track the official master branch instead of your fork's master branch
# If you cloned the official repo:
git remote set-url origin --push disabled # Prevent accidental push to official repo (team members only)Explanation (click to show/hide)
|
Earlier, when you cloned the repository, a default remote called When The official repository should only ever be used with Tracking the upstream master branch means that |
Use this command to view names and URLs of all remote repositories that Git is aware of:
git remote -vHint: You can create additional remotes later on with git remote add [name] [url]. This is useful if you ever need to fetch code from another person's fork.
| Previous | Current | Next |
|---|---|---|
| Install Qt and Qt Creator | Top of page | Install dependencies |
Testing
- Manual testing
- Automatic testing
Translation
Compilation
- Set up developer environment
- Install Qt and Qt Creator
- Get MuseScore's source code
- Install dependencies
- Compile on the command line
- Compile in Qt Creator
Beyond compiling
Architecture
Misc. development
Audio
Engraving
- Style settings
- Working with style files
- Style parameter changes for 4.0
- Style parameter changes for 4.1
- Style parameter changes for 4.2
- Style parameter changes for 4.3
- Style parameter changes for 4.4
Extensions
- Extensions overview
- Manifest
- Forms
- Macros
- Extensions API
- Legacy plugin API
Google Summer of Code
References