Solution: Understanding HTTP, REST, and APIs
Let’s try to push our local changes to the shared GitHub repository in the cloud.
Solution
The task in this exercise is to move the services
folder (and all the API calls stored there) into the project repository we created earlier.
To keep things clear, we’ll start from the beginning by creating a new onboarding
folder, making it a Git repository, and then copying the services
folder into the repository and committing the changes.
Note: You can see the
services
folder’s content by executing thecd services
andls
commands in the terminal provided below.
Here’s a step-by-step solution.
Creating local Git repository
First, create the onboarding
project folder and change the directory to that new folder:
root@educative:/$ mkdir onboarding
root@educative:/$ cd onboarding
root@educative:/onboarding$
Next, make this new empty folder into a Git repository:
root@educative:/onboarding$ git init
Initialized empty Git repository in /home/mca/onboarding/.git/
root@educative:/onboarding$
Next, let’s add a README file to the repository. It’s always a good idea to use README files to help remember what’s in the repository and why it was created. For this example, we can create a simple text file that contains the following text and save it to the disk as a file named git-readme.md
:
Get hands-on with 1400+ tech skills courses.