Git commands

For the first-time user

As a first-time user, use these Git commands to create a new local repo, stage changes, commit, and push to GitHub. To update, stage changes, commit with a message, and push again. Remember to copy the SSH code first.

git init ----------------------- Create a new local repo

git diff ----------------------- Show changes not yet staged

git status ----------------------- List new or unmodified files

git add . ----------------------- Stage all changed files

git commit -m “message” ----------------------- Commit changes

copy the git hub 3 lines of ssh code

git push -u origin main ----------------------- Push local repo into the origin

git push ----------------------- Push the repo

Once the file is online to update simply push

To update an already uploaded file on GitHub, you need to first stage the changes using "git add ." Then, commit the changes using the "git commit -m "message". Finally, push the changes using "git push" to update the file on the repository.

git add . ----------------------- Stage all changed files

git commit -m “message” ----------------------- Commit changes

git push ----------------------- Push the repo