Template:Blacksmiths Setting up Locally: clone

Note: After finishing the above steps, it is important that from this point onwards you are logged in to your computer using the same user account that you will use when you will be developing code for Habitica. Do not log in as. When elevated permissions are needed, this page will tell you to use. Using elevated permissions at other times will cause problems.

Close any command windows or terminal windows that you have open from previous steps. When you need a command/terminal window again, open a new one so that your shell environment is aware of the software you have installed so far.

Fork and Clone Habitica
Acquire a copy of Habitica's codebase. There are multiple methods of doing this; the following is the simplest method, and is based on GitHub's Fork A Repo article.


 * 1) Fork Habitica's repository by going to https://github.com/HabitRPG/habitica and clicking on the "Fork" button. This creates a copy of Habitica's repository in your own GitHub account.
 * 2) On your machine, open a command prompt or terminal window. Change to the directory that you want to Habitica's codebase to be copied under.
 * 3) Clone your copy of Habitica's repository with the command below (replace "YourUsername" with your GitHub username). This will copy Habitica's code onto your machine, placing the repository into a new "habitica" directory under your current directory.


 * 1) Change into the "habitica" directory that was created by the above step:

Remain in that directory for all future steps on this page, unless advised otherwise.
 * 1) Configure Git to sync your fork with Habitica's repository.

origin  https://github.com/ YourUsername/habitica.git (fetch) origin  https://github.com/ YourUsername/habitica.git (push) upstream https://github.com/HabitRPG/habitica.git (fetch) upstream https://github.com/HabitRPG/habitica.git (push)
 * 1) Verify that everything is set up properly by typing  which should produce output the same as the following but with your GitHub username in place:

Remain in the Correct Branch and Directory
After you have cloned Habitica's repository, you will be in the  branch by default. This is the correct branch to be in when installing Habitica locally. You do not need to change to any other branches but if you do for any reason, you must switch back to the develop branch with  before proceeding further with the installation. You can check which branch you are on with  (the branch with a star next to it is the branch you are currently on).

After you have followed all the steps above, you will be in Habitica's top-level directory. You must remain in that directory for all future steps on this page, unless advised otherwise. All commands below are written on the assumption that you are in that directory. If you change out of that directory for any reason, change back into it before continuing with the instructions on this page. If you want to check whether you are in the correct directory, look for a file called  - if you see that in your current directory, then you are in the right one.