-
Git, as a version control system, creates a timeline with multiple versions of a project. 1 Git = 1 Project
-
Github allows to share changes with others. Backup of all time lines in a single place.
- Tracking code changes
- Tracking who made changes
- Coding collaboration
- Manage projects with Repositories
- Clone a project to work on a local copy
- Control and track changes with Staging and Committing
- Branch and Merge to allow for work on different parts and versions of a project
- Pull the latest version of the project to a local copy
- Push local updates to the main project
-
Developing Area:
Where do you develop a project? The folder where you initialize git and where the project is developed.
-
Staging Area: Location used to prepare new snapshots to the timeline before commiting. Q. How often should we use git commit? Why Staging Area is important?
- It goes differently by project and person
- If you commit too often, you will end up too many updates (too redundant) that make it difficult to track back important changes you've made.
-
Local Repository: The place where you store the snapshots of your timeline. Where you save snapshots. Check by
ls -la
git add
-
Remote Repository: github repository
- Initialize Git on a folder, making it a Repository
- Git creates a hidden folder to keep track of changes in that folder
- When a file is changed, added or deleted, it is considered modified
- You select the modified files you want to Stage
- The Staged files are committed, which prompts Git to store a permanent snapshot of the files
- Git allows you to see the full history of every commit.
- You can revert back to any previous commit.
- Link a bridge between local repository and remote repository
- Give the same names (advised)
- You can create tag to a certain commit e.g. V1.0
- You can work on the same project with your collaborators. To avoid conflicts, it is better to make use of branches.
- You can merge branches to the master/main branch.
bold
italic
Code location $ ls
Several lines of codes