Git <-> GitHub
git vs GitHub git is a local software that manages a local version control repository and communications with remote repositories. GitHub is a web service that provides storage and management of a remote git repository.
git documentation https://git-scm.com/doc
Working with git Working with a remote repository remote push fetch Working with the local repository Init status add commit log branch checkout merge reset config Working with a remote repository remote push fetch pull
distributed version control system The development environment with: Working directory Staging area or index Local repository A server with: Remote repository
Cloning a repository Working directory Local repository
Making changes in the working directory There are 2 types of files in the working directory: Tracked: files that Git knows about. Untracked: files that have still not been added, so Git doesn’t know about.
Updating the remote repository As changes are ready in the working directory, they must be added in the staging area. When there is a set of changes with a single purpose in the staging area, it’s the time to create a commit with a message about that purpose in the local repository. When there are one or several commits in the local repository ready to be shared with the rest of the world, they must be pushed to the remote repository.
Different states of a file Different states of a file in the development environment: Modified Staged Committed.
Updating the development environment - Fetching When executing git fetch, the data from remote repository only travels to the local repository.
Updating the development environment - Pulling When executing git pull, the data from remote repository travel to 2 areas: To local repository: fetch To working directory: merge
Attributions https://git-scm.com/doc https://rachelcarmena.github.io/2018/12/12/how-to-teach-git.html