- To set up a local copy of the LearnOSM site on your computer so you can preview the changes you have made, you must create a copy (or fork) of the site through your GitHub account and then add it to your computer using Git on the command line.
Note: You only need to complete these steps once
-
Navigate to the LearnOSM site repository at
https://github.com/hotosm/learnosm
on GitHub. -
To create a copy of the site repository click the fork button in the right hand corner.
-
Next you should see GitHub making a copy of the main LearnOSM site repository owned by hotsom.
Now, you should see your own copy or fork of the LearnOSM site repository on GitHub.
Check out GitHub's guide on forking if you need more help.
You can download your copy of the site to your computer using the command line or GitHub Desktop. Either way to preview a local copy of your site you must use the command line but cloning your site with GitHub Desktop is easier.
-
Find the HTTPS URL and copy it to your clipboard. https://guides.github.com/activities/forking/
-
Open up your command line.
-
Navigate to the place on your computer where you want to store your local copy of the learnosm site. In this example we will save it in a folder or directory called opensource.
- 2.1 Create a directory called "opensource" or whatever you prefer.
$ mkdir opensource
- 2.2 Navigate into your new directory
$ cd opensource
opensource$
- Download your forked copy of the site to your computer by running this command
git clone https://github.com/hotosm/learnosm.git
You should see the site download.
If you run into any problems check out GitHub's Cloning a repository guide.
-
Install GitHub Desktop and authenticate to GitHub using the "Setting up GitHub Desktop" guide.
-
Save a copy of your learnosm fork by using the "Cloning a repository from GitHub Desktop" guide.
To open your local copy of the site in the command line, right click on the learnosm repository clone in the left corner and select "open in the terminal" or "open in the command prompt." You can also open your local copy of the site in a text editor such as Atom from right clicking on your repository in GitHub Desktop.
-
On GitHub Navigate to the original hotosm/learnosm repository
-
Copy the HTTPS URL at the top of the repository. You will use this as the upstream repository URL later on.
- For an example see step 2 of this Sync a fork guide.
-
If you haven not already, navigate to the place that you cloned your learnosm site on the command line.
-
To sync your local copy with hotosm/learnosm follow these steps for Configuring a remote for a fork starting with step 2 and using
https://github.com/hotosm/learnosm.git
as your upstream repository URL.