# Open your project's command line/terminal and navigate to the project's root directory
# Initialize a new Git repository
git init
# (Optional) Create a .gitignore file to ignore specific files or directories from being tracked by Git
# Example: ignore the "node_modules" directory
echo "node_modules/" >> .gitignore
# Add the existing project's files to the Git repository
git add .
# Commit the changes (creating the initial commit)
git commit -m "Initial commit"
# Connect the local Git repository to a remote repository (e.g., GitHub)
# Create a new repository on GitHub (if not already done)
# Example: Connect to a remote repository named "origin"
git remote add origin <remote_repository_url>
# Push the changes to the remote repository
git push -u origin master