Advertisement
Guest User

Untitled

a guest
Feb 16th, 2016
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. git init
  4.  
  5. # this is needed for me to make sure they conflict, being in fact texts
  6. # maybe for you it would be a good idea too
  7. echo 'bindir/** merge=binary' >.gitattributes
  8.  
  9. seq 1 10 >noconflict
  10. seq 1 10 >conflict
  11. mkdir -p bindir/sub
  12. seq 1 10 >bindir/file
  13. seq 1 10 >bindir/sub/file
  14. git add .
  15. git commit -m init
  16.  
  17. # branch changes
  18. sed -i noconflict -e s/3/m3/
  19. sed -i conflict -e s/5/m5/
  20. sed -i bindir/file -e s/3/m3/
  21. sed -i bindir/sub/file -e s/3/m3/
  22. git commit -a -m br
  23.  
  24. git branch br
  25. git reset --hard HEAD~1
  26.  
  27. # HEAD changes
  28. sed -i noconflict -e s/8/m8/
  29. sed -i conflict -e s/5/n5/
  30. sed -i bindir/file -e s/8/m8/
  31. sed -i bindir/sub/file -e s/8/m8/
  32. git commit -a -m master
  33.  
  34. # here comes merge; "conflict", and "bindir" content conflict
  35. git merge br
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement