This is something I regularly end up needing to do; maybe writing this down will help me remember how to do in future!
- If you haven’t already, create a new repo in Github
- From the comand line in your local project folder type:
git init
- Include your new files in your local repo:
git add .
- Step 3 also stages the files, so now commit them to your local repo:
git commit -m "
replace with your commit message
"
- Get the https url of your GitHub repo and add this as your remote repo:
git remote add origin
your_remote_repo_url
git remote -v
- Now push your local changes to your remote repo:
git push -f origin master
Refresh your repo on GitHub and , hey presto, there’s all your files