Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [user@localhost ~]$ mkdir temp;cd temp;git init;git checkout -b stable
- Initialized empty Git repository in /home/user/temp/.git/
- Switched to a new branch 'stable'
- [user@localhost temp]$ echo "a" >file1; echo "b" >file2
- [user@localhost temp]$ git add file1 file2; git commit -am 'step1'
- [stable (root-commit) b0da231] step1
- 2 files changed, 2 insertions(+)
- create mode 100644 file1
- create mode 100644 file2
- [user@localhost temp]$ git checkout -b fix1 ; echo "c" >file3; git add file3; git commit -am 'step2'
- Switched to a new branch 'fix1'
- [fix1 36f8fb6] step2
- 1 file changed, 1 insertion(+)
- create mode 100644 file3
- [user@localhost temp]$ git checkout stable; git checkout -b fix2;echo 'new' >file2; git commit -am 'step3';git checkout stable; git merge fix2
- Switched to branch 'stable'
- Switched to a new branch 'fix2'
- [fix2 9e3cd7b] step3
- 1 file changed, 1 insertion(+), 1 deletion(-)
- Switched to branch 'stable'
- Updating b0da231..9e3cd7b
- Fast-forward
- file2 | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- [user@localhost temp]$ git checkout fix1
- Switched to branch 'fix1'
- [user@localhost temp]$ git merge stable -m 'step4'
- Merge made by the 'recursive' strategy.
- file2 | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
- [user@localhost temp]$ echo another >file3
- [user@localhost temp]$ git commit -am 'step5'
- [fix1 fab70e4] step5
- 1 file changed, 1 insertion(+), 1 deletion(-)
- [user@localhost temp]$ git log
- commit fab70e43e1c3cedc422d697cad3dab1c9e35434f
- Author: Alexander Kulikov <a.kulikov@id-network.ru>
- Date: Thu Feb 27 17:52:30 2020 +0300
- step5
- commit 21677f0eb149bc5bb2afa34361854c034915b215
- Merge: 36f8fb6 9e3cd7b
- Author: Alexander Kulikov <a.kulikov@id-network.ru>
- Date: Thu Feb 27 17:52:08 2020 +0300
- step4
- commit 9e3cd7b02927d3f3feb4782d751c39be213ebe69
- Author: Alexander Kulikov <a.kulikov@id-network.ru>
- Date: Thu Feb 27 17:51:38 2020 +0300
- step3
- commit 36f8fb6eef3490bd14271dcd1845762595288418
- Author: Alexander Kulikov <a.kulikov@id-network.ru>
- Date: Thu Feb 27 17:50:59 2020 +0300
- step2
- commit b0da231139e945837f317f1296de867df1ecadda
- Author: Alexander Kulikov <a.kulikov@id-network.ru>
- Date: Thu Feb 27 17:50:26 2020 +0300
- step1
- [user@localhost temp]$ git revert -m 1 21677f0eb149bc5bb2afa34361854c034915b215
- [fix1 bb4ff83] Revert "step4"
- 1 file changed, 1 insertion(+), 1 deletion(-)
- [user@localhost temp]$ git checkout stable
- Switched to branch 'stable'
- [user@localhost temp]$ git merge fix1 -m step6
- Updating 9e3cd7b..bb4ff83
- Fast-forward
- file2 | 2 +-
- file3 | 1 +
- 2 files changed, 2 insertions(+), 1 deletion(-)
- create mode 100644 file3
- [user@localhost temp]$ cat file1
- a
- [user@localhost temp]$ cat file2
- b
- [user@localhost temp]$ cat file3
- another
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement