Advertisement
Guest User

Untitled

a guest
Apr 15th, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.83 KB | None | 0 0
  1. #!/bin/bash
  2. rm -Rf repo
  3. mkdir repo
  4. cd repo
  5. git init
  6. mkdir folder
  7. echo a > folder/a
  8. echo b > folder/b
  9. git add .
  10. git commit -m "First commit."
  11. rm folder/b
  12. echo c > folder/c
  13. git add .
  14. git commit -m "Second commit."
  15. cd folder
  16. git checkout `git log --pretty=format:%H | tail -1` .
  17. echo "###################################################################"
  18. git status
  19. echo "###################################################################"
  20. rm *
  21. git checkout `git log --pretty=format:%H | head -1` .
  22. echo "###################################################################"
  23. git status
  24. echo "###################################################################"
  25. git add .
  26. echo "###################################################################"
  27. git status
  28. echo "###################################################################"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement