Creating a remote repository

A remote repository is usually a bare git folder. It don’t necessary to be in a remote server. Actually we can make it somewhere in the same system.

In this example, we create a remote folder in the same system.

  1. Choose a place that’s not part of the current project folder. For example, I chose to make the remote folder in the Dropbox folder.
    cd /ShareDrive
    mkdir sample-project-remote.git
    cd sample-project-remote.git
  2. Make sure it is an empty folder. Then we run the following git init command with the --bare option.
  3. git init --bare

What’s happening?

We just created a remote repository. If you list the files and directory inside the remote repository, it looks similar to what you list I the .git folder inside our previous got controlled project.

Note on using Dropbox folder as remote repository

I tried. It works most of the time, until it created inconsistent when 2 or more team members are pushing changes to the remote at the same time.