Tracking and committing changes to Git repository
- In last lab we initiated or created a git repository
- In this lab we will track the changes are done to the files inside the project folder
- Will do get commit will do a git add first which will basically add the changes inside a staging area
git add .
Inside the git add command.
represents all the files inside the current repository - Let’s check what is git tracking now
git status
- Then we’ll do a git commit which will basically commit the changes or else in simple words you can say it will create a snapshot of the changes which we have done
git commit -m "Initial commit"
-m
helps us to put the comment - Lets check is commit done proper and no changes felt to be snapshotted
git status
- Let’s do some more changes
echo "some changes added" >> app.py
- Now let’s do git add
git add .
- and then let’s look at commit
git commit -m "updated app.py code"