GitDeepDive/scriptActions.md

2.2 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 cds into it.

  3. Initialised a git repository in that location with the command

git init <location>`
  1. Sets the user's git user name with the command
git config --local user.name "Gaius Julius Caesar"
  1. Sets the user's git user e-mail address with the command
git config --local user.email gjcaesar@pontifexmaximus.rm
  1. Creates a text file called information.md

  2. Adds and commits the new file will the commands

git add information.md
git commit -m "commit1"
  1. Makes a change to the text file.

  2. Adds and commits that change will the commands

git add information.md
git commit -m "commit2"
  1. Makes another change to the text file.

  2. Adds and commits that change will the commands

git add information.md
git commit -m "commit3"
  1. Creates, from master, and then checks out a new branch using the command
git checkout -b Rel1
  1. Makes a change to information.md

  2. Adds and commits that change will the commands

git add information.md
git commit -m "commit4"
  1. Makes another change to the text file.

  2. Adds and commits that change will the commands

git add information.md
git commit -m "commit5"
  1. Creates, from master, and then checks out another new branch using the commands
git checkout master
git checkout -b Rel2
  1. Makes a change to information.md

  2. Adds and commits that change will the commands

git add information.md
git commit -m "commit6"
  1. Makes another change to the text file.

  2. Adds and commits that change will the commands

git add information.md
git commit -m "commit5"
  1. Checks out master with the command
git checkout master
  1. Prints out the commit history log of the repositoty, showing the changes on all branches, with command
git log --oneline --graph --decorate --all