git logo

Connecting Git To An Existing Project Folder
Published: 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:

  1. start a project on my laptop in a folder somewhere;
  2. decide I'd better version control it, because it's getting interesting;
  3. create a repository on GitLab or GitHub (which one depends on my mood);
  4. 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.

git logo

Connecting Git To An Existing Project Folder
Published: 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:

  1. start a project on my laptop in a folder somewhere;
  2. decide I'd better version control it, because it's getting interesting;
  3. create a repository on GitLab or GitHub (which one depends on my mood);
  4. 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.