■ Git Workflow Summary
■ 1. First-Time Setup (Initial Push)
Used when you create a new project or initialize a Git repo for the first time.
Commands:
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin <your-repo-URL>
git push -u origin main
■ This step sets up your Git repository, connects it to GitHub, and pushes your
code for the first time.
✏■ 2. Regular Updates (After Initial Setup)
Used when you’ve already connected the repo and just want to push changes.
Commands:
git add .
git commit -m "Your message"
git push
■ This is your daily workflow: stage changes, commit them, and push updates to
GitHub.
■ Key Point:
• Use the first method once, when initializing the project.
• Use the second method regularly to keep your GitHub repository up to date.