Connecting Git To An Existing Project FolderPublished: 18-Aug-2019
I’ve stolen this instruction-set from GitLab. I use it all the time, and I wish GitHub would publish something so simple.
Finding this specific information amongst all the ‘great advice’ via a Google Search is a nightmare.
My general workflow is:
- start a project on my laptop in a folder somewhere;
- decide I'd better version control it, because it's getting interesting;
- create a repository on GitLab or GitHub (which one depends on my mood);
- then try to remember how to add the repository to the folder...
Here's how GitLab recommend you do it:
Push an existing folder
cd existing_folder git init git remote add origin git@[YOUR-REPO-PATH].git git add . git commit -m "Initial commit" git push -u origin master
And that's it.