How to add a new project into Github using VSCode
cd /path/to/your/project
git init
git add .
# Commit with a descriptive message
git commit -m "Initial commit: Describe your project or changes"
git add filename1 filename2
git remote add origin https://github.com/yourusername/your-repo-name.git
git push -u origin main
git push
Additional Tips:
Create a .gitignore file to exclude unnecessary files:
# Create .gitignore in project root
touch .gitignore
# Example contents to ignore
node_modules/
.env
*.log
Common Troubleshooting:
If you're using the default branch name master instead of main:
git push -u origin master