Hosting git private libraries on Dropbox

Source: Internet
Author: User
Tags goagent

---------------- Follow-up ----------------

My friend and I used Dropbox for SVN synchronization and found that there was no way to achieve this effect immediately after I submitted it, therefore, this article is not very reliable. The only difference in the past is to find a free VPN to access free private libraries in foreign countries. Many free VPN pods seem to have a monthly traffic of M. If the project is not large, it should be enough. Recently, the goagent is very difficult. stable (Beijing region ), therefore, it is not recommended to use goagent for Wall-over synchronization.
.

I searched for the private code repository, but none of them satisfied. GitHub was the first choice. I spent money on it. I found such an article and reprinted it.


Git is a popular distributed version control software. It was first developed by Linus for Linux to manage Linux kernel. Later, most people thought it was very useful, it gradually became popular. Many open-source projects such as Debian, Perl, gnome, and Android use git for version control, including git itself and Linux kernel.

As for Dropbox, you don't need to talk about it. According to GFW's law, all products with walls are good products. you can know that Dropbox is definitely a good product.

Transfer to the subject. Recently, I worked with a friend to develop a project. The Code cannot be made public. GitHub's free account can only be used to create a public warehouse. A private warehouse requires a fee of 7 $ per month. With the idea of saving and saving, I began to look for other ways to store git repositories. You can also build a server on your own on the local machine, but it is quite troublesome. At this time, you thought of Dropbox.

Dropbox provides a shared folder function to share a specified folder with others. Isn't this a ready-made online repository? It facilitates multi-host, multi-platform access and limits access personnel. Start building from scratch immediately after Google has some materials.

I use snow leopard 10.6.7, which is similar to Linux/win. Install the GIT and Dropbox clients respectively to start the operation.
First, create a folder in Dropbox and share it with the collaborators AA. Assume that the folder name is repo. After that, both AA and I can access the repo. Next, open the terminal and initialize a remote repository in the repo.

// The Dropbox folder synchronized from my local machine is located in ~ /Dropbox
Cd ~ /Dropbox/repo // switch to the repo directory
Git -- bare init // initialize the Repository

There are two methods to initialize the GIT Library: git init and git -- bare init. The difference between the two is that executing git init will create a file in the current directory. the GIT directory stores the GIT library, while the current directory stores the project files as the working directory. The -- bare parameter uses the current directory as the GIT library directory instead of creating one. git subdirectory. Git init is generally used in the local initialization repository, while the -- bare parameter is added in the initialization remote repository. Because the remote repository is generally used to store git libraries, no one will check out or edit files in the remote repository.


Step 2: add the project to the GIT repository.

// Assume that my project directory is located in ~ /Myproject
Cd ~ /Myproject // switch to the project directory
Git init // initialize a local git library in the current directory
Git Add. // Add all files in the current directory to the index
Git commit-M "first commit" // submit
Now, all the files in myproject have been incorporated into git management. Next ~ /Myproject directory, run the following command:

// Set ~ /Dropbox/repo added as a remote repository, alias: droprepo
Git remote add droprepo file: // $ home/Dropbox/Repo
 
// Push the master branch of the Local warehouse to the remote warehouse
Git push droprepo master
OK, open now ~ /Dropbox/Repo, you will find ~ /All files under myproject have been updated to the GIT library. You can execute the following command to clone the content of a repository wherever your Dropbox is synchronized:

// Repository address, that is, the path of the Dropbox/repo synchronized on your machine
Git clone file: // $ home/Dropbox/Repo

Of course, the co-author aa who shares the repo folder can also execute the above command on his machine to obtain the repository content. Then follow the GIT Method for normal development. After all the updates are submitted, remember to push git to the remote repository.


Address: http://blog.csdn.net/fanwenbo/article/details/8671157

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.