Week 9 Class 16 Thu Mar 09 Posted: Mar 09
After Class
Midterm
Midterm scores and feedback are posted in Brightspace:
Announcements
Class
Exercise 31: Git Commands I
asciinema is a way to record terminal sessions. It records the commands that you enter and the output the command produces. You will use it to record exercises involving git
commands.
After you install asciinema on Linux/WSL/macOS, it is quite straightforward to use.
You can play, pause, skip, etc. You can also copy the commands as text.
For this exercise, you will use the GitHub Classroom Git1 invitation link in Brightspace.
With this repository, performing the following instructions using git. As you enter commands, record your terminal session with asciinema. Commands must be typed with no copy/paste. When completed, save the URL that asciinema gives you and enter it into this form
touch list.txt
issue1
echo "a" >> list.txt
Here is a reference to the commands used:
Description | Command |
---|---|
Status | git status |
Difference in the working copy | git diff |
Add a file to staged commits | git add <filename> |
Difference of staged commits | git diff --staged |
Push the changes to GitHub | git push |
Current branch | git branch |
Create a branch | git checkout -b <branchname> |
Move to an existing branch | git checkout <branchname> |
Commit all changes in working copy | git commit -am "<commit_message>" |
Commit all staged commits | git commit -m "<commit_message>" |
Pull the changes from another branch | git pull origin <another_branch> |
Difference of two branches | git diff <branch1>..<branch2> |
All exercises are due by 4:30 pm on Fri Mar 10