Basic Process of git Code Management in Enterprises

Source: Internet
Author: User

Now, many companies choose to use git to manage their own code based on git's many advantages. The basic process is as follows:

1. create and develop your own branch

 
Git checkout-B mybranch; // create and switch to the branch mybranch

2. After the development is complete, place the data from the local disk to the temporary storage area.

 
Git add file1 [file2] [...];//Put the new or modified file file1, file2. .. into the temporary storage area.

3. submit to this warehouse

 
Git commit-M [Message]-N;//Adding-N indicates ignoring the syntax error in the comment.

4. Switch to the master and update the master to the latest version.

 
Git checkout master;//Switch to masterGit pull;//Pull the latest code remotely and merge it to the master.

5. Switch to the branch and merge the master branch. In case of conflict, you must manually resolve the problem.

 
Git checkout mybranch;//Switch to branch mybranchGit merge master;//Merge the latest code on the master.

6. Push the branch to the remote Repository

 
Git push origin mybranch: liyun/mybranch;//Push the local mybranch branch to the remote branch liyun/mybranch, wait for the review of others' code, and then submit the code to the remote mster by merge.

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.