GitHub Setup & Local Integration
- Michael He
- Sep 27, 2025
- 2 min read
Updated: Oct 4, 2025

Summary -
Create a GitHub Account
Install Git Locally
Configure Git Locally - (Git's Local Architecture!)
Initialize "Local Repo"
Add files into "Staging Area"
Commit files into "Local Repo"
Push "Local Repo" to "Remote Repo" - Github
Add a "README" file
Add a ".gitignore" file: something you do't want to get to be pushed to the GitHub
Git Clone via SSH & testing with # git clone
Create a GitHub Account
Go to github.com
Click Sign up and follow the prompts to create your account.
Choose a username, enter your email, and set a secure password.
Verify your email and complete the onboarding steps.
Install Git Locally
Download Git from git-scm.com
Run the installer and accept default settings (especially “Git from the command line” option).
To verify:

Configure Git Locally
Git's Local Architecture:
WORKING DIR -> STAGING AREA -> LOCAL REPO

Run the following commands:
# git config --global user.name "user name"
# git config --global user.email "your_email@example.com"
to check user.name and user.email
# git config --global user.name
# git config --global user.email
git config --global init.defaultBranch main # change default branch to main
to check branch # git config --global init.defaultBranch
Initialize local repository
Open your project with VS code
(I am using a mock project for demo purpose)

Initialize local repository
# git init
It will create a .git file. If you want to delete it, just # rm -rf .git

- You noticed the files became in green and having a "U" next to them, which meaning they are un-tracked now
- They are still in "working area"
To check status: # git status

Add files into "staging area"
# git add <file_name>

notice: file index.html became "A" - added to "staging area"
To add ALL files into "staging area" # git add .
Commit files into "Local Repo"
# git commit -m 'Initial commit to local repo'

Now, if you are making any changes to your project and/or files, you will need to add them to both staging and local repo AGAIN!
"staging area": # git add .
then to "local area": # git commit -m 'message_here'

To check history / logs: # git log
Push "Local Repo" to "Remote Repo" at Github
Create a repo at github side, normally make the repo same name as your project

b. Copy and run these commands on your local PC once you click "Create repository" button above


Now I am showing my files on Github repo now -

Add a "README" file



Now, we can pull this README file from your local PC: # git pull


Add a ".gitignore" file
Say you have .env file, and you do not want get it to the Github

You add the .env filename into .gitignore file

# git add . -> git commit -m 'Added gitignore file' -> git push

Now you will see .gitignore file on Github, but .env file isn't here -

Git Clone via SSH

Now you need to put public key to Github -
Copy your public key:



** make sure you run the following commands

To test:





Comments