GitDeepDive/scriptActions.org

2.3 KiB

simple-setup.sh

  1. Setup actions

    • Load the utility script
    • Sets the default location that the sample repository is to be prepared in
    • Checks if a command-line parameter has been passed, and re-set to the location to that value if so.
    • Removes the target location if relevant.
  2. Creates the location where the new repository will reside and cd's into it.
  3. Initialised a git repository in that location with the command

    git init <location>
    
  4. Sets the user's git user name with the command

    git config --local user.name "Gaius Julius Caesar"
    
  5. Sets the user's git user e-mail address with the command

    git config --local user.email gjcaesar@pontifexmaximus.rm
    
  6. Creates a text file called information.md
  7. Adds and commits the new file will the commands

    git add information.md
    git commit -m "commit1"
    
  8. Makes a change to the text file.
  9. Adds and commits that change will the commands

    git add information.md
    git commit -m "commit2"
    
  10. Makes another change to the text file.
  11. Adds and commits that change will the commands

    git add information.md
    git commit -m "commit3"
    
  12. Creates, from master, and then checks out a new branch using the command

    git checkout -b Rel1
    
  13. Makes a change to information.md
  14. Adds and commits that change will the commands

    git add information.md
    git commit -m "commit4"
    
  15. Makes another change to the text file.
  16. Adds and commits that change will the commands

    git add information.md
    git commit -m "commit5"
    
  17. Creates, from master, and then checks out another new branch using the commands

    git checkout master
    git checkout -b Rel2
    
  18. Makes a change to information.md
  19. Adds and commits that change will the commands

    git add information.md
    git commit -m "commit6"
    
  20. Makes another change to the text file.
  21. Adds and commits that change will the commands

    git add information.md
    git commit -m "commit5"
    
  22. Checks out master with the command

    git checkout master
    
  23. Prints out the commit history log of the repositoty, showing the changes on all branches, with command

    git log --oneline --graph --decorate --all