Build your own git server on projectlocker

Source: Internet
Author: User
Tags key string git client version control system

Projectlocker is a service provider that provides the project code hosting service. A free account can have a space of MB. A maximum of three projects can be created for developers with a maximum of three members. This is sufficient for small projects developed in their spare time, the trouble of copying the code on a USB flash drive is avoided. If the USB flash drive fails or is lost, it will be miserable.

Projectlocker supports two version management systems: Subversion and git. SVN can be used by people on earth. Git is more anti-human. It was easy to get started with tortoisegit. Here we will introduce how to do this.

First go to The http://www.ProjectLocker.com to register a free account, Account type to choose the free of charge, initial repository type select subversion or git can be, in addition to the project can be changed. After successful registration will send a welcome letter to your mailbox, and then log on to the https://portal.projectlocker.com can begin to add, manage your own project.

Now there are no projects under the Account. Add a project first, click Add project in the list on the left, enter the Project Name and description, select git for version library management, and click Create project, after the project is created, is it quite simple?

Then we create a public key and a private key pair. ComeHereDownload puttygen and run it. Click Generate to move the mouse cursor randomly in the blank area of the interface and move the progress bar to the header.

Save the private key first, and click Save private key to save the private key as a PPK file. I didn't set a password for the private key here, if necessary, you can enter the password in key passphrase and confirm passphrase, and then save the PPK file. Do not close puttygen, then place the created public key on projectlocker, log on to the http://portal.projectlocker.com, select Manage public keys from the list on the left
-> New Key, copy and paste the public key string circled in the red box to the key column.

The last thing to do is to configure the local git client. I am using msysgit + tortoisegit.

First, create a local repository. Right-click the blank folder, select git clone, there are three places to set, the first is the URL, back to the http://portal.projectlocker.com, list the currently valid project list in account status, each project is marked with the corresponding git URL. The second is the local folder. Note that a sub-folder is automatically created under the current folder as the local repository, and the third is the private key, select the path of the PPK file of the previously saved private key.

The configuration page is as follows:

Click OK. If the private key is password-protected, enter the private key password. The local warehouse has been created.

After creating a local repository, add code files to it. Import the code file into or create a new project in this folder. Delete unnecessary temporary files and run the GIT add command:

You need to confirm the changes:

Complete (you can also directly commit it to the GIT repository on the local machine, but I usually don't do this, and then checkin it together after each function completes the test ):

After a functional block is written and tested normally, it will not cause build break. Then, you can checkin to the GIT repository on the local machine. Then you can use the GIT commit command:

Write comments about this change to facilitate management:

In this case, the checkin is complete. From this we can see that the biggest difference between distributed version control and centralized version control such as git is that checkin is carried out on the local machine, and the local warehouse can do whatever it is, you can use it by yourself. For centralized version control, you must be very cautious before checkin. In case of build break, it will seriously affect others' work. For example, in Microsoft, many projects except TFs use source depot for management. This is a command line-based centralized version control system, A project is usually used by teams around the world to work together. Everyone goes to the source depot server for checkin, and China will go off work to checkin their own changelist, the team in the United States will be able to sync to the latest code early in the morning, and wait for the engineers in the United States to checkin before work. The Chinese Team will be able to get the latest change the next morning, so the first thing we did early in the morning was to first install SD.
Sync and make a full private build as needed. If your checkin introduces build break, the official build of the current day will be closed and need to be restarted. It takes several hours to build a full build for a large project, A full build for a Windows project requires daily computing. Not only does tester fail to complete the day's work, but engineers from other countries have to help you change the code while you are sleeping, so in Microsoft, checkin is a matter of caution. Especially when developing with teams from other countries, you must do private build and buddy before checkin.
Build, and make sure that your change will not lead to build break again and again, so people are somewhat obsessive. If the change is significant, you have to let tester help you test your function on Buddy build and it will not cause regression, and add an insurance. If distributed version control is used, it will alleviate the problem that this kind of irresponsible checkin causes everyone to stop eating. Of course, there is also a way to use a centralized version control system, that is, to open up a new branch. Everyone is working on the branch, but the problem is that when there are more branches, establish fi (forward integration) and RI (reverse) between branches
Integration.

All right, our daily changes are made on the local machine, but we still need to release them for use by other engineers, at this time, you need to push the changes of the local machine to the main server of projectlocker. You can use the push command. It is very simple and can be done at any time. You can immediately push the changes after each commit, you can also choose to execute the push command at any time:

At this time, tortoisegit prompts you to select the branch of the remote warehouse. Here, select the default master:

Success:

Go to projectlocker and check the result:

The text.txt file has been successfully uploaded to the projectlocker server.

What should I do if I need to continue working? Create a local warehouse on the home computer, and then clone the remote warehouse to the local machine using the clone command.

I went back to the office the next day and wanted to proceed with the last night's schedule. What should I do? Use git sync to synchronize changes to the remote repository to the local repository:

Synchronization completed:

What have I changed?

Full text ~~

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.