How-To-Git-Started/assignments/README.md

2.9 KiB

Assignments

Assignment 1: Create a folder using the CLI

  1. Use the command line to navigate to your desktop folder
  2. Create a folder called CIT
  3. Move inside the CIT folder
  4. Check to see your current working directory

Assignment 2: Setup git

  1. Set the default git text editor (e.g. nano)
  2. Set your username
  3. set your email address

Assignment 3: Create a local repository

  1. Go into your CIT directory
  2. Initialize it as a local git repository

Assignment 4: Create a file

  1. Make sure you are still in your local repo
  2. Create a file using the CLI and name it git_workshop.txt
  3. Check the status of your repo

Assignment 5: Add a file to staging

  1. Tell git to track the just created file git_workshop.txt
  2. Check the status of your repo

Assignment 6: Commit changes

  1. Check the status of your repo. Make sure the changes listed respresent exactly what you want to commit.
  2. Commit the change with a message that explaind and describes what changes you made.

Assignment 7: Check the progress

  1. Now check the progress of the repo
  2. Exit the log afterwards

Assignment 8: Undoing modified/tracked changes

  1. Open git_workshop.txt
  2. Add some changes to it
  3. Undo these changes using git

Assignment 9: Unstage a file

  1. Add a new file to your repo
  2. Stage the file
  3. Unstage the just staged file

Assignment 10: Uncommit and keep all changes

  1. Add changes to the git_workshop.txt file
  2. Stage and commit the changes
  3. Uncommit your commit

Assignment 11: Uncommit without keeping all the changes

  1. Stage and commit the change
  2. Uncommit your commit without keeping all the changes

Assignment 12: Create a remote repository

  1. Go to https://git.web.rug.nl
  2. Create your own remote repository
  3. Add a .gitignore file
  4. Add a README.md

Assignment 13: Your first push

  1. Clone your repository
  2. Edit your README.md file
  3. Create a new file(s) and add something to it
  4. Stage README.md and your file(s)
  5. Commit README.md and your file(s)
  6. Push your commit

Assignment 14: Create a new branch

  1. Create a new file file with some content
  2. Stage, commit and push it
  3. Create a new branch
  4. Checkout the new branch
  5. Edit the just created file and push it into the new branch

Assignment 15: Check the logs

  1. Checkout the master branch
  2. Check the logs
  3. Checkout the just created branch
  4. Check the logs

Assignment 16: Merge the branches

  1. Checkout the master branch
  2. Merge it with the other branch
  3. Check the logs
  4. Delete the other branch

Assignment 17: Work together in pairs

  1. Person A adds person B as collaborator
  2. Person A creates a file called share.txt and adds some text
  3. Person B clones the shared repository
  4. Person A and B change the same line of text within share.txt
  5. Person B commits and pushes the changes
  6. Person A pull the changes
  7. Solve the merge conflict