Chapter III Introduction to GIT usage experience

Source: Internet
Author: User
Tags version control system

Chapter III Git Getting Started with

Experience

Learn android in Depth (Vol. 1) HAL and Driver Development Chapter III Git Getting started, first I have a certain understanding of Git is a version control system. The official explanation is that versioning (Revision control) is a software engineering technique. Second, I mastered Git's use of the process.

First step: Create a new branch

First, each time you develop a new feature, you should create a separate branch

# get the latest skeleton code

$ git Checkout Master

$ git pull

# Create a new development branch Myfeature

$ git checkout-b myfeature

Step two: Commit the Branch commit

After the branch is modified, you can commit the commit.

Step Three: Compose submission information

When committing a commit, you must give a complete summary of the submitted information,

Fourth step: synchronizing with the backbone

During the development of the branch, you should always keep in sync with the trunk.

$ GIT fetch origin

$ git rebase origin/master

Fifth Step: Merge Commit

After the branch development is complete, it is possible to have a bunch of commits, but when merging into the trunk, it is often desirable to have only one (or up to two or three) commits, which is not only clear, but also manageable.

Sixth step: push to remote repository

Once the commit is merged, you can push the current branch to the remote repository.

$ git push--force origin myfeature

The git push command has to add the Force parameter, because after rebase, the branch history changes, and the remote branch is not necessarily compatible, it is possible to push (see here).

Seventh step: Issue Pull request

After committing to the remote repository, you can issue a pull request to the master branch and then request someone else to code review, confirming that it can be merged into master.

http://www.cnblogs.com/yun123456/

Chapter III Introduction to GIT usage experience

Related Article

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.