- Explain what Git is
- Use Git to manage a local repository
Lets go through this list of steps together. As we work through each step, take notes about the commands used.
- Create a new directory called 'things'. cd into that directory.
- Initialize a git repository.
- Create a new text file with the name of your favorite
<thing>. Example: touch pizza.txt - Check the status of your repo to confirm that your new file exists and has not yet been added to your repo.
- Add the new file to your staging area.
- Commit the new file to you repo with the message "added [filename].txt to the repo"
- Open the file in your text editor and write a short sentance about yout chosen
<thing>. - Check the status of your repo to see your changes.
- Add your changes to the staging area.
- Check the status to confirm that your changes have been added to the staging area.
- Commit the changes to your repository with the message "added first line"
- Repeat the previous steps (3-11), adding a second
<thing>to the file. - Commit these lines one at a time.
- Run the fancy git log command (git log --oneline --graph --decorate --all) to see your commit history. You should see your 5 commits have been added to the graph. Congrats! You've used the git add and git commit commands to add and track changes to your project.