6/21/14

Git repository on my Drop Box!


My DropBox folder is mapped to a local directory:

 C:\Users\Yoshi\DropBox

I manually created a folder for my project

C:\Usrs\Yoshi\DropBox\Gits\MyProject.git

CD into MyProject.git and issue

C:\Users\Yoshi\DropBox\Gits\MyProject.git> git init --bare

Now I have a git repository on DropBox, which will, needless to say, automatically sync up with its cloud image.

Let's make a local working repository.

D:\Projects\

CD into this new directory, then

D:\Projects\> git clone C:\Users\Yoshi\DropBox\Gits\MyProject.git LocalProject

This creates

D:\Projectrs\LocalProject.

Since its empty, let's add a file.

C:\Projects\LocalProject> notepad.exe hello.txt

After you put some texts and save the file, issue two commands

C:\Projects\LocalProject> git add hello.txt
C:\Projects\LocalProject> git commit -a -m "Added a new file!"

Now we got a file in our DropBox-based git respository.

Go to another computer where your DropBox is also installed. Let's say it is at (note, it may be different from other computers):

C:\Users\yoshiwatanabe\DropBox

Then you should see

C:\Usres\yoshiwatanabe\DropBox\Gits\MyProject.git

You can create another local repository on this different computer

C:\development\> git clone C:\Users\tsuyoshiwatanabe\DropBox\Gits\MyProject.git LocalProject

This creates

C:\development\LocalProject

With hello.txt in it.

This way, you can work on your project from many different computers.

No comments: