Using Git to create a local warehousing management code "go"

Source: Internet
Author: User

Transferred from: http://blog.csdn.net/airk000/article/details/7738231

Git is a code management tool for Linus, which is simply a developer's Super gospel, and as a personal developer of Dick Wire, buying a server or GitHub pay service is obviously not a bargain, so can you build a git repository to manage your code locally? The answer is of course you can!

(Install Git or something will not say, very simple apt-get install git-core OK)

In this example, the warehousing is set to ~/git_store/, and the code for the development is located in the folder ~/git_example/

So build Git_store first.

Mkdir-p Git_store

CD Git_store

Git init--bare

OK, now that the warehouse has been set up, just waiting to hoard the code inside.

CD ~/git_example

Git init

/* will appear to indicate that you have built an empty git */

Git addx

/* Add all the files in the current directory */

Git commit-m ' first commit '

/* Commit for the first time, no commit is not allowed for push */

Git remote add Origin ~/git_store

/* Add origin, the name pointing to ~/git_store,origin can be any, the default branch is master*/

Git push Origin Master

/* This step is completed after the code has been submitted, you can use GITK verification */

OK, now you can safely start to modify the code, even if what happened unexpectedly can be restored through the local git storage, but also can establish a number of branches for different requirements development, without the purchase of servers and GitHub pay services, local can also be convenient, secure development and management of code!

Using Git to create a local warehousing management code "go"

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.