Introduction
Overview
Teaching: 10 min
Exercises: 0 minQuestions
Key question (FIXME)
Objectives
Review important points from the lesson “Version Control with Git”.
Recap: Important Git Commands
git config
- configure personalized settings for Git.git init
- initializes a new Git-repository.git status
- shows the status of the repository.git add
- adds a file to the staging area.git commit
- store staged changes as a new change-set (commit).git diff
- show differences between versions. By default the difference between working directory and staging area.git log
- shows list of versions (commits).git checkout
- recover old versions of files and switch branches.git remote
- adds or changes the location of the remote report.git push
- copy commits from local repository to remote repository.git pull
- copy commits from remote repository to local repository (fetch) and integrate (merge) them into working directory.git clone
- creates a local copy of a remote repository.
Recap: the Git working Cycle
Working locally
graph TD
A[ git init ] -- creates new repository --> C ;
C([create and edit files]) --> D ;
D[ git add ] -- adds files to staging area --> E ;
E[ git commit ] -- commits changes to local repository --> G ;
G([working directory clean]) ----> C;
Typical workday with remote repository
graph TD
A{start} --> B ;
B[ git pull ] -- retrieve changes from remote --> C ;
C([create and edit files]) --> D ;
D[ git add ] -- adds files to staging area --> E ;
E[ git commit ] -- commits changes to local repository --> F ;
F[ git push ] -- push commits to remote repository --> G ;
G([working directory clean]) --> H{end of day};
E -- continue working --> C ;
G -- continue working --> C ;
H -- new day --> A ;
Key Points
First key point. Brief Answer to questions. (FIXME)