Deploying a web app like our full-stack Spring Boot + React To-Do List often starts by pushing the source code to GitHub. If you've encountered issues with the traditional username/password authentication (especially after GitHub disabled password-based logins), this guide will walk you through using a Personal Access Token (PAT) instead.
π Step 1: Generate a Personal Access Token
-
Click "Generate new token (classic)".
-
Add a descriptive name, like
"todo app push access"
. -
Set an expiration date (e.g., 30 or 90 days).
-
Under Scopes, check at least:
-
repo
(full control of private repositories)
-
-
Click Generate Token.
-
Copy the token now. GitHub will not show it again.
π Step 2: Initialize Git in Your Project
If you haven’t already, open your terminal (Git Bash on Windows) and navigate to your project folder:
cd /c/todo_app
Initialize the Git repo:
git init
git add .
git commit -m "Initial commit for full-stack To-Do app"
π Step 3: Add Your Remote Repository
Go to https://github.com, create a new repository called todo
.
Then link your local project to it:
git remote set-url origin https://<token>@github.com/<username>/todo.git
Replace yourusername
with your GitHub username.
π Step 4: Push Code Using the Personal Access Token
When you run:
git push -u origin main
✔️ Once successful, your project is live on GitHub.
No comments:
Post a Comment