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.