git concepts

  • repository: the “container” that tracks the changes (all the commits) to your project files.
Untracked | Unmodified |    Modified |   Staged 
| — — git add — — — — — — — — — — — -----— ->|
| — git add — — -> |
| — edit — — -> |
| <-- git commit — — — — — — — -|
| <-- remove — — — — — — |
Untracked | Unmodified | Modified | Staged | --- git add ------------------------------------------->|
| -- git add -----> |
| -- edit -----> |
| <--- git commit -----------------|
| <--- remove ------------|

git commands

inspect

  • git log : show the list of commits

modify

  • git add: when a file is added, it is not tracked by git. For a untracked file, git add puts the file in track (in the working tree) and in the staging area. For a tracked and modified file, git add puts it in the staging area.

remote

  • git clone: clone from a remote repo. two ways

Original Post: https://gug11.github.io/2019/12/21/gitbasic.html

Reference

  1. https://www.atlassian.com/git/tutorials/setting-up-a-repository

Software Engineer@Facebook

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store