I came across an artificial describing how to use dropbox as a private git repository and thought I would try the same using my copy.com account.
First thing I did was to navigate to the location where I wanted to create the bare git repository and opened the git BASH terminal, once that was done I typed the following (amend the paths to suite your situation):
cd /d/Copy/Git
git init --bare poseidon.git
You should see the following:
Initialized empty Git repository in D:/Copy/Git/poseidon.git/
Next I navigated to my working projects directory and created a folder for my project, then move into that directory:
cd /d/Projects/Repositories/
mkdir poseidon
cd poseidon/
Now I needed to initialize a Git repository in the working directory so that I can start adding files for my first commit.
git init
I received the following:
Initialized empty Git repository in d:/Projects/Repositories/poseidon/.git/
Once the base files were added, I commited the changes with the following:
git add .
git commit -m "Initial Commit"
Note: If you only want to add individual file you can do this with:
git add testfile.txt
Now I needed to hook up the new bare repository as an upstream for my project so I can push the changes upstream.
git remote add origin /d/Copy/Git/poseidon.git/
To check if the remote repository was added I used the following:
git remote -v
It displayed the following:
origin d:/Copy/Git/poseidon.git/ (fetch)
origin d:/Copy/Git/poseidon.git/ (push)
Note: If at any time you need to remove a remote a repository this can be done with:
git remote rm RepositoryName
i.e. git remote rm origin
To push the changes upstream I used the following:
git push origin master
It worked as you can see from below:
Counting objects: 96, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (96/96), done.
Writing objects: 100% (96/96), 109.31 KiB | 0 bytes/s, done.
Total 96 (delta 63), reused 0 (delta 0)
To d:/Copy/Git/poseidon.git/
* [new branch] master -> master
Now the changes are pushed up to the remote repository I can now easily clone it and carry on as normal from another machine.
git clone /d/Copy/Git/poseidon.git/ Poseidon
All done:
Cloning into 'Poseidon'...
done.