SHARE
TWEET

Untitled

a guest Feb 27th, 2020 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [user@localhost ~]$ mkdir temp;cd temp;git init;git checkout -b stable
  2. Initialized empty Git repository in /home/user/temp/.git/
  3. Switched to a new branch 'stable'
  4. [user@localhost temp]$ echo "a" >file1; echo "b" >file2
  5. [user@localhost temp]$ git add file1 file2; git commit -am 'step1'
  6. [stable (root-commit) b0da231] step1
  7.  2 files changed, 2 insertions(+)
  8.  create mode 100644 file1
  9.  create mode 100644 file2
  10. [user@localhost temp]$ git checkout -b fix1 ; echo "c" >file3; git add file3; git commit -am 'step2'
  11. Switched to a new branch 'fix1'
  12. [fix1 36f8fb6] step2
  13.  1 file changed, 1 insertion(+)
  14.  create mode 100644 file3
  15. [user@localhost temp]$ git checkout stable; git checkout -b fix2;echo 'new' >file2; git commit -am 'step3';git checkout stable; git merge fix2
  16. Switched to branch 'stable'
  17. Switched to a new branch 'fix2'
  18. [fix2 9e3cd7b] step3
  19.  1 file changed, 1 insertion(+), 1 deletion(-)
  20. Switched to branch 'stable'
  21. Updating b0da231..9e3cd7b
  22. Fast-forward
  23.  file2 | 2 +-
  24.  1 file changed, 1 insertion(+), 1 deletion(-)
  25. [user@localhost temp]$ git checkout fix1
  26. Switched to branch 'fix1'
  27. [user@localhost temp]$ git merge stable -m 'step4'
  28. Merge made by the 'recursive' strategy.
  29.  file2 | 2 +-
  30.  1 file changed, 1 insertion(+), 1 deletion(-)
  31. [user@localhost temp]$ echo another >file3
  32. [user@localhost temp]$ git commit -am 'step5'
  33. [fix1 fab70e4] step5
  34.  1 file changed, 1 insertion(+), 1 deletion(-)
  35. [user@localhost temp]$ git log
  36. commit fab70e43e1c3cedc422d697cad3dab1c9e35434f
  37. Author: Alexander Kulikov <a.kulikov@id-network.ru>
  38. Date:   Thu Feb 27 17:52:30 2020 +0300
  39.  
  40.     step5
  41.  
  42. commit 21677f0eb149bc5bb2afa34361854c034915b215
  43. Merge: 36f8fb6 9e3cd7b
  44. Author: Alexander Kulikov <a.kulikov@id-network.ru>
  45. Date:   Thu Feb 27 17:52:08 2020 +0300
  46.  
  47.     step4
  48.  
  49. commit 9e3cd7b02927d3f3feb4782d751c39be213ebe69
  50. Author: Alexander Kulikov <a.kulikov@id-network.ru>
  51. Date:   Thu Feb 27 17:51:38 2020 +0300
  52.  
  53.     step3
  54.  
  55. commit 36f8fb6eef3490bd14271dcd1845762595288418
  56. Author: Alexander Kulikov <a.kulikov@id-network.ru>
  57. Date:   Thu Feb 27 17:50:59 2020 +0300
  58.  
  59.     step2
  60.  
  61. commit b0da231139e945837f317f1296de867df1ecadda
  62. Author: Alexander Kulikov <a.kulikov@id-network.ru>
  63. Date:   Thu Feb 27 17:50:26 2020 +0300
  64.  
  65.     step1
  66. [user@localhost temp]$ git revert -m 1 21677f0eb149bc5bb2afa34361854c034915b215
  67. [fix1 bb4ff83] Revert "step4"
  68.  1 file changed, 1 insertion(+), 1 deletion(-)
  69. [user@localhost temp]$ git checkout stable
  70. Switched to branch 'stable'
  71. [user@localhost temp]$ git merge fix1 -m step6
  72. Updating 9e3cd7b..bb4ff83
  73. Fast-forward
  74.  file2 | 2 +-
  75.  file3 | 1 +
  76.  2 files changed, 2 insertions(+), 1 deletion(-)
  77.  create mode 100644 file3
  78. [user@localhost temp]$ cat file1
  79. a
  80. [user@localhost temp]$ cat file2
  81. b
  82. [user@localhost temp]$ cat file3
  83. another
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top