You need to be signed on github.com. If you don’t have an account yet, create one.
Open the AzerothCore repository and create a fork of it by clicking in the top-right “Fork” button:
Once your fork is ready, you will see a screen showing YourUsername/azerothcore-wotlk.
Click on the “Clone or download” button (on the right) and copy the https address of your fork:
Now open the terminal (if you are on Windows, use the git bash terminal)
git clone followed by the git address of your fork that you just copied:
git clone https://github.com/YourUsername/azerothcore-wotlk.git
Wait until the download ends and then access the
IMPORTANT: never commit changes your
master branch, it will make your fork messy.
When creating a new branch, git will create a copy of your current branch.
Always make sure you are on
master branch before creating a new branch by typing:
git checkout master
Create a new branch giving it a name that is different than any existing branch.
You can give any name you want (replace “xxx” with whatever you are fixing):
git checkout -b fix-issue-xxxx
If you don’t have any C++ changes, you can skip this. Otherwise, open your editor and do them now! I’ll wait…
In this guide we will assume that you modified the file
Now add your file(s) to be committed:
git add src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp
If you modified more files, just add them using
git add path/to/file
You can use the
git status command to check which files have been selected to be committed:
If you don’t have any SQL changes, you can skip this. Otherwise, run the following:
This will generate a new file located at
having a unique name that looks like
Open it with a text editor. You will notice that it contains some SQL code like:
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('XXXXXXXXXXXX');
Do NOT remove this line. Add your SQL code below and save it.
Now add this file to be committed using the
git add path/to/file command:
git add data/sql/updates/pending_db_world/rev_XXXXXXXXXXXX.sql
(of course replace
rev_XXXXXXXXXXXX.sql with the actual name of the file)
First of all make sure to use the AC commit template (this should only be necessary once):
git config --local commit.template ".git_commit_template.txt"
Then commit your changes using:
You are then prompted to specify an appropriate commit message (please follow the format guidelines here).
Now it’s time to push them remotely.
If you use the
git push command for the first time in this branch,
git will ask to specify which remote branch you want to push to.
So you should give:
git push --set-upstream origin fix-issue-xxxx
(of course replace
fix-issue-xxxx with the actual name of your branch)
Go back to the main AzerothCore repository, you will notice that GitHub is smart enough to realize that you are about to open a PR and shows this nice light-yellow box:
click on the “Compare & pull request” green button (located on the right).
Now fill the PR template following the instructions that will appear in the screen, do not forget to add the testing instructions so people can be able to test your PR and it can be merged:
It’s also a good practice to check the “File changes” tab to see that everything is in place as you expect:
Just edit/add the files that you want,
git add them, then commit & push again.
If you refresh your PR’s page you will see the changes.
Just repeat the procedure starting from the step 3.
Be careful when creating a new branch: you must be in branch
master first (type
git checkout master).
If you never updated your fork before, type:
git remote add upstream https://github.com/azerothcore/azerothcore-wotlk.git
Then follow these steps:
git checkout master
git fetch upstream
git merge upstream/master
git push origin master
Your fork is now updated.
You have to update your fork’s master branch first (see above).
git checkout your-branch and
git merge master.
This is an open source project and people work in their free time, so we cannot estimate it.
What we can recommend is: write clear instructions to test your PR, so it will be easy for anyone to test it.
If your test instructions are not clear or missing at all, only advanced users will be able to test your PR and it will take much more time.
But any linux/mac terminal is ok too. If you are so unlucky to be on windows, use git bash.