Advertisement
Guest User

Untitled

a guest
May 20th, 2015
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.98 KB | None | 0 0
  1. [myself@somehost ~]$ mkdir bubu
  2. [myself@somehost ~]$ cd bubu
  3. [myself@somehost bubu]$ git init
  4. Initialized empty Git repository in /home/myself/bubu/.git/
  5. [myself@somehost bubu]$ cat > file
  6.  
  7.  
  8. [myself@somehost bubu]$ git add file
  9. [myself@somehost bubu]$ git commit
  10. [master (root-commit) 30b5b60] first
  11.  1 files changed, 2 insertions(+), 0 deletions(-)
  12.  create mode 100644 file
  13. [myself@somehost bubu]$ git checkout -b branch1
  14. Switched to a new branch 'branch1'
  15. [myself@somehost bubu]$ emacs file
  16. [myself@somehost bubu]$ # added a in first line
  17. [myself@somehost bubu]$ git commit -a -m 'added a in first line'
  18. [branch1 4ac5e60] added a in first line
  19.  1 files changed, 1 insertions(+), 1 deletions(-)
  20. [myself@somehost bubu]$ git checkout 30b5b60
  21. Note: checking out '30b5b60'.
  22.  
  23. You are in 'detached HEAD' state. You can look around, make experimental
  24. changes and commit them, and you can discard any commits you make in this
  25. state without impacting any branches by performing another checkout.
  26.  
  27. If you want to create a new branch to retain commits you create, you may
  28. do so (now or later) by using -b with the checkout command again. Example:
  29.  
  30.   git checkout -b new_branch_name
  31.  
  32. HEAD is now at 30b5b60... first
  33. [myself@somehost bubu]$ git checkout -b branch2
  34. Switched to a new branch 'branch2'
  35. [myself@somehost bubu]$ emacs file
  36. [myself@somehost bubu]$ git commit -a -m 'added b in second line'
  37. [branch2 d6817e7] added b in second line
  38.  1 files changed, 1 insertions(+), 1 deletions(-)
  39. [myself@somehost bubu]$ git merge branch1
  40. Auto-merging file
  41. CONFLICT (content): Merge conflict in file
  42. Automatic merge failed; fix conflicts and then commit the result.
  43. [myself@somehost bubu]$ emacs file
  44. [myself@somehost bubu]$ # I resolved the conflict wrong on purpose
  45. [myself@somehost bubu]$ git commit -a # On purpose I get rid of the message
  46. [branch2 7b57499] merge with hidden conflicts
  47. [myself@somehost bubu]$ gitk
  48. [myself@somehost bubu]$ #gitk did not show the manually resolved conflict
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement