What Git Commit is?
Work done so far
- We have create a new folder and done the activites as shown below
- Now lets check for status
- Lets make 3 changes (2 in existing files in commit and create a new file)
- In Git Untracked files are the files that were not part of local repo and a new file is created.
- Now commit the changes
- HEAD is a pointer which generally points to latest commit, Working tree will populate the contents based on HEAD which refers to commit
- Add some changes to staging area
- To remove the changes from working tree for a tracked file
- Lets see how to remove untracked which is in staging area
- Now lets create a 3 commit
- git log in short form
git log --oneline
- In Git by default there will be one branch which is called as master which looks at latest commit id.
- Checkout commands moves the HEAD position. By default as master points to latest commit, HEAD points to master. IF you want navigate back in history
git checkout <commit-id>to get back to latest commit
git checkout master
- Note: checkout has other flavors which we are yet to know.