Advertisement
Guest User

Untitled

a guest
Aug 29th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. $ git init
  2. Initialized empty Git repository in /home/markf/so/.git/
  3. $ vi a.txt
  4. $ git add .
  5. $ git commit -m '1'
  6. [master (root-commit) d92b23b] 1
  7. 1 file changed, 1 insertion(+)
  8. create mode 100644 a.txt
  9. $ git hist
  10. * d92b23b 2015-08-29 | 1 (HEAD, master) [mark.fisher]
  11.  
  12. $ git checkout -b f1 master
  13. Switched to a new branch 'f1'
  14. $ vi a.txt
  15. $ git add .
  16. $ git commit -m '2 on f1'
  17. [f1 1db4fed] 2 on f1
  18. 1 file changed, 1 insertion(+), 1 deletion(-)
  19.  
  20. $ git checkout -b f2 master
  21. Switched to a new branch 'f2'
  22. $ git hist
  23. * d92b23b 2015-08-29 | 1 (HEAD, master, f2) [mark.fisher]
  24.  
  25. $ vi a.txt
  26. $ git add .
  27. $ git commit -m '3 on f2'
  28. [f2 807e4a7] 3 on f2
  29. 1 file changed, 1 insertion(+), 1 deletion(-)
  30.  
  31. $ git hist
  32. * 807e4a7 2015-08-29 | 3 on f2 (HEAD, f2) [mark.fisher]
  33. * d92b23b 2015-08-29 | 1 (master) [mark.fisher]
  34.  
  35. $ git checkout master
  36. Switched to branch 'master'
  37.  
  38. $ git merge --no-ff f2
  39. Merge made by the 'recursive' strategy.
  40. a.txt | 2 +-
  41. 1 file changed, 1 insertion(+), 1 deletion(-)
  42.  
  43. $ git hist
  44. * d193d0a 2015-08-29 | Merge branch 'f2' (HEAD, master) [mark.fisher]
  45. |
  46. | * 807e4a7 2015-08-29 | 3 on f2 (f2) [mark.fisher]
  47. |/
  48. * d92b23b 2015-08-29 | 1 [mark.fisher]
  49.  
  50. $ git merge --no-ff f1
  51. Auto-merging a.txt
  52. CONFLICT (content): Merge conflict in a.txt
  53. Automatic merge failed; fix conflicts and then commit the result.
  54.  
  55. $ git status
  56. On branch master
  57. You have unmerged paths.
  58. (fix conflicts and run "git commit")
  59.  
  60. Unmerged paths:
  61. (use "git add <file>..." to mark resolution)
  62.  
  63. both modified: a.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement