How to Commit to GitHub?

Open a terminal in your project folder

Run `git init` if the folder is not already a Git repository

Run `git status`

Run `git add .` to stage all changes

Run `git commit -m “Your commit message”`

Create a repository on GitHub

Copy the repository URL

Run `git remote add origin `

Run `git branch -M main`

Run `git push -u origin main`

For later changes, run `git add .`

Run `git commit -m “Your commit message”`

Run `git push`

Suggested for You

Trending Today