Git & GitHub Study Notes
Git & GitHub Study Notes
● Git is a distributed version control system used to track changes in source code during
software development.
● Created by Linus Torvalds in 2005.
● Allows multiple developers to work on a project simultaneously.
● Provides features like branching, merging, and history tracking.
What is GitHub?
● GitHub is a web-based platform that uses Git for version control and collaboration.
● Offers cloud-based storage for Git repositories.
● Provides features like pull requests, issue tracking, and project management.
● A storage space where your project files and version history are kept.
● Can be local (on your computer) or remote (on GitHub).
Branch
Commit
Stage
● The process of adding changes to the staging area before committing.
● Prepares changes to be committed to the repository.
Merge
Clone
● A request to merge changes from one branch or fork into another repository.
● Allows for code review and collaboration before merging.
Fork
Remote
Conflict
● Occurs when changes from different sources overlap and Git cannot automatically
resolve them.
● Requires manual resolution.
Installing Git
Windows:
Creating a Repository
Cloning a Repository
● git status
● git log
Forking a Repository
Pull Requests
Command Description
Best Practices
● Commit frequently with meaningful messages.
● Use .gitignore to exclude unnecessary files.
● Keep your main branch clean and stable.
● Use branches for feature development.
● Always pull before making new changes.