GIT branch extension instance

Source: Internet
Author: User
The principle of Git combination is to submit updates at the same time in two branches, and merge the updates in one branch, which is equivalent to the patch of the other branch to update itself, the branch to be derived does not change. [Root @ localhostwanyan] # virebase1 [root @ localhostwanyan] # catrebase1first [root @ localhostwanyan] # virebas

The principle of Git combination is to submit updates at the same time in two branches, and merge the updates in one branch, which is equivalent to the patch of the other branch to update itself, the branch to be derived does not change.

[Root @ localhost wanyan] # vi rebase1

[Root @ localhost wanyan] #CatRebase1

First

[Root @ localhost wanyan] # vi rebase2

[Root @ localhost wanyan] # cat rebase2

1

[Root @ localhost wanyan] #GitInit

InitializEdEmpty Git repository in/git/wanyan/. git/

[Root @ localhost wanyan] # gitDd.

[Root @ localhost wanyan] # git commit-m'1st commint'

[Master (root-commit) 9e8b3Cd] 1st commint

2FileS changed, 2 insertions (+), 0 deletions (-)

Create mode 100644 rebase1

Create mode 100644 rebase2

[Root @ localhost wanyan] # git braNcH laji

[Root @ localhost wanyan] # git branch

Laji

* Master

[Root @ localhost wanyan] # git checkout laji

Switched to branch 'laji'

[Root @ localhost wanyan] # vi rebase1

[Root @ localhost wanyan] # cat rebase1

First

Two

[Root @ localhost wanyan] # git commit-a-m "laji"

[Laji 065 adde] laji

1 files changed, 1 insertions (+), 0 deletions (-)

[Root @ localhost wanyan] # git checkout master

Switched to branch 'master'

[Root @ localhost wanyan] # vi rebase2

[Root @ localhost wanyan] # cat rebase2

1

2

[Root @ localhost wanyan] # git commit-a-m "master"

[Master ce848ae] master

1 files changed, 1 insertions (+), 0 deletions (-)

[Root @ localhost wanyan] # git branch

Laji

* Master

[Root @ localhost wanyan] # git checkout laji

Switched to branch 'laji'

[Root @ localhost wanyan] # git branch

* Laji

Master

[Root @ localhost wanyan] # git rebase master

First, rewinding head to replay your work on top of it...

Applying: laji

[Root @ localhost wanyan] # cat rebase1

First

Two

[Root @ localhost wanyan] # cat rebase2

1

2

[Root @ localhost wanyan] # git branch master

Fatal: A branch named 'master' alreadyExIsts.

[Root @ localhost wanyan] # git checkout master

Switched to branch 'master'

[Root @ localhost wanyan] # cat rebase2

1

2

[Root @ localhost wanyan] # cat rebase2

1

2

[Root @ localhost wanyan] # cat rebase1

First

This is a separate instance only to understand the principle and has no practical significance.

 

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.