Add first file
Duration: 2 minutes
Based on:
1. Set-Up
1.1 Open PowerShell window
1.2 Restore state from backup copy
Copy the code, right-click in PowerShell window to paste it and press Enter to execute
cd ~/Documents/git-workoutsCopy-Item bak-1.1 current -Recurse -Forcecd current2. Create, Stage, Commit
2.1 Create file named README.md
Type in PowerShell prompt and press Enter to execute
New-Item README.md2.2 Check current status of the Working Tree
Type in PowerShell prompt and press Enter to execute
git status
2.3 Stage file
Type in PowerShell prompt and press Enter to execute
git add README.mdAdditional Info
In Git terms, selecting files for a snapshot is called stage a file.
2.4 Check current status of the Working Tree
Type in PowerShell prompt and press Enter to execute
git status
2.5 Commit changes
Type in PowerShell prompt and press Enter to execute
git commitAdditional Info
- In Git terms, creating a snapshot of the Working Tree's file system is called a commit.
- Vim is Git's default editor. This setting will be changed later.
3 Edit commit message with Vim
3.1 Switch to INSERT mode
Press i to switch to INSERT mode in the Vim editor

Additional Info
You can switch between modes in Vim by pressing i to enter INSERT mode andEsc to return to COMMAND mode.
3.2 Type a description
Add empty README.md3.4 Switch to COMMAND mode
Press Esc to exit INSERT mode

3.5 Save changes and exit
Type :wq and press Enter to save changes and exit Vim

Additional Info
- Specifying a commit message is mandatory.
- Lines starting with the
#symbol will be ignored and won't be included in the commit message.
4. Post-commit steps
4.1 Check current status of the Working Tree
Type in PowerShell prompt and press Enter to execute
git status
4.2 View commit history of the repository
Type in PowerShell prompt and press Enter to execute
git log
5. Wrap-Up
5.1 Make backup copy
Copy the code, right-click in PowerShell window to paste it and press Enter to execute
cd ..Copy-Item current bak-1.2 -Recurse -ForceRemove-Item current -Recurse -Force