Setting up a bare-repository with an existing working directory and pulling from this bare-repository

51 Views Asked by At

I want to realise the following scenario:

Currently I have an application running on my server for which I yet do not use Git.

I want to setup a bare-repository on my server, so that changes that I push automatically become productive code. Additionally I want to host a project on GitLab hosted by my university for version control and collaborative development as a second remote repository.

My idea would now be the following:

  1. Setup the existing directory as the working directory of the bare repository.
  2. Pull the files to my local repository.
  3. Create a project on GitLab
  4. Push those files to the GitLab project

From there on my workflow would be that I would locally work on changes and that I push them to both remote directories.

My questions:

  1. Step 2 does not seem to be possible - my search yields that I can't pull the files in the sense that I get the working files directly in my local working directory as I would with a non-bare repository. Is there a simple way to do this?

  2. Does this workflow even make sense? I'm new to using Git and open for any suggestions.

0

There are 0 best solutions below