15 min
- Initialize a new directory in your workspace
- Navigate to your WDI code directory and create a new folder
mkdir [directory name]
- Change into your new directory
cd [directory name]
- Use
git init
to initialize a new Git repository
- Create 3 new files
- Use
touch [filename]
- Check the status of your Git repository
- Use
git status
- Note that the three files you've added are marked as untracked because you haven't added them to Git yet
- Start tracking these files by adding them to Git
- Use
git add [filename]
for all the files you created - Check the status of your git repository now by using
git status
- Note that the files are now marked as new file
- Commit your changes
- Use
git commit -m "[Brief description of the changes made]"
- Edit a couple of your files with some new content
- Check the status of the repository with
git status
- Notice that your files are now marked as modified
- Commit your new changes
- Use
git commit -m "[Brief description of the changes made]"
- View the history of commits
- Use
git log
to view the history of commits made