0

I have initialized a Git repository in local C:/pathtosite/.git/ ...

I've created a private repository on GitLab ...

My goal is to continue working on my site locally, but have version control ...

Hours later, I'm still having issues trying to understand what to do next ...

codr
  • 889
  • 3
  • 13
  • 22

2 Answers2

6

You need to add your files and push them to your repository.

git add -A
git commit -m 'first commit'
git remote add origin git@gitlab.domain.com:username/repository.git
git push -u origin master

Step by step:

Add all files in repository

git add -a

Commit files (with commit message 'first commit')

git commit -m 'first commit'

add your remote gitlab repository(git@gitlab.domain.com:username/repository.git) as origin

git remote add origin git@gitlab.domain.com:username/repository.git

push your files to origin

git push -u origin master

Hope this helps?

fupduck
  • 490
  • 4
  • 12
0

If I understand your question right, you've run

git init

locally, and created a repository on GitLab? If so, the issue is that you're not quite following the standard workflows for git. You don't want to explicitly initialize your local git repository. Instead, following the gitlab documentation:

  1. Go to your repository page on gitlab
  2. Copy the https URL it gives you on the right-hand side of the page
  3. Take that URL, and run git clone the-url-goes-here one level above where you would like the local copy to go (i.e. if you want the repository in C:\my\gits\path\repo, run this command in C:\my\gits\path).

Once you do that, you'll have a local copy you can work in under version control. fupduck's answer below covers what you'll want to do once you have that repository working with regard to adding files and making changes.

BlueSpaceCanary
  • 411
  • 3
  • 6
  • Yeah. Normally I use this way as well. But the other way round should work as well ;) – fupduck Mar 23 '16 at 17:09
  • Thanks for you help ... I remembered I have a student micro account with GitHub, installed GitHub desktop, dragged in live site folder and already am up and running, learning more about branches ... #Respect – codr Mar 23 '16 at 18:38