Advertisement
Guest User

Untitled

a guest
Apr 17th, 2011
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. #!/usr/bin/sh
  2. rm -rf repo
  3. mkdir repo
  4. cd repo
  5.  
  6. git init
  7. echo -e "A\nB\nC\nD\nE" > test.txt
  8. git add .
  9. git commit -am "a"
  10.  
  11. git branch c
  12. git checkout c
  13. echo -e "A\nB\nX\nD\nE" > test.txt
  14. git commit -am "c1"
  15.  
  16. git checkout master
  17. echo -e "G\nG\nG\nA\nB\nC\nD\nE" > test.txt
  18. git commit -am "b1"
  19. echo -e "A\nB\nC\nD\nE\nG\nG\nG\nA\nB\nC\nD\nE" > test.txt
  20. git commit -am "b2"
  21.  
  22. git checkout c
  23.  
  24. if [ -z $1 ]; then
  25.     # this produces incorrect result
  26.     git rebase master
  27. else
  28.     # but if we go through revisions manually instead, we get the correct result
  29.     git rebase master~1
  30.     git rebase master
  31. fi
  32.  
  33. cat test.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement