Github Installation

Github Installation

How to Install GitHub

The next step is to clone the repository from Github to our local machine. Go to your Github repository home page, click the green Code button, select HTTP, and copy the web address, as shown below with the MyDashApps repository.

img-repo

Next, start VScode and open a new terminal:

img-terminal

and enter:
git clone *web address copied from Github*

img-repo

Now that your file has been cloned to your computer, you need to initiate git by typing inside the terminal: git init:

img-gitinit


Press enter, enter your github account credentials (might need to set up git config here for first time)

git config --global user.name "bolajiayodeji"
git config --global user.email mailtobolaji@gmail.com

Test the stack

Let’s make sure everything has been installed correctly. Open the newly cloned folder in VScode and create a new file called main.py. Copy and paste this code inot the file:

import dash 
import dash_bootstrap_components as dbc
import pandas

print("Hello World!")

img-gitinit

Click the Run tab located in the top section of VScode; then click Run Without Debugging to run the file. If we see Hello World! printed out in the terminal, we know the Python code is working properly with all libraries installed.

img-vscode

Now that we have our main.py file running, let’s use git to track the file in our repository. Go to the terminal in VScode and go into the cloned directory by typing cd MyDashApps (modify MyDashApps with the name of your repository). Then, type git status. We see that there is an Untracked file called main.py since we have not committed that file yet:

img-status

We’ll add that folder to the git staging area by typing: git add main.py.

Then, we need to commit the changes. Type in git commit -m "This is a commit message". Every commit needs a message and this is a good opportunity to include a short reminder of what this commit changed:

img-commit

Lastly, with the file committed, it is now ready to be uploaded to our online GitHub repository by typing: git push.

img-push

If you go to github, you should now see the new main.py file in your github repository.