Professional Documents
Culture Documents
Getting Started: What & Why?
Getting Started: What & Why?
Getting Started: What & Why?
Draft 4 Draft 4
Draft 20 Draft 20
Another draft Another draft
Final Final
Optional
Git Git &
Mac Terminal & Windows
The Basics GitHub
Command Prompt
Git
Deep Dive
Optional: Command Line Basics
Run Code
Execute Files
User Friendly Time Saving
Terminal Shell
pwd cd /Users rm
(print working directory) (users directory) (delete file)
ls cd or cd ~ rmdir
(list items) (home directory) (delete empty folder)
cd (..) touch cp
(change directory) (create/ ”touch” file) (copy file/folder)
cd / mkdir mv
(root directory) (create directory) (move file/folder)
Windows: Command Prompt – Useful Commands
The Basics
Module Content
Working Directory
Commit
“Snapshot 1“ index.html styles.css images
Web Shop
Commit
“Snapshot 2“ styles.css
Commit
“Snapshot 3“ script.js
Git under the Hood
add commit
styles.css styles.css styles.css
head
Detached HEAD
Unstaged Changes
Staged Changes
Latest Commit(s)
Branches
Basic Commands Summary: General
Git 2.23+
Resolving Conflicts
Combining Master & Feature Branches
? ?
Goal:
Combining master & feature branch
Merge Types
Fast-Forward
Non Fast-Forward
Recursive Octopus
Ours Subtree
Master & Feature – Merge (“fast-forward“)
No additional commit in
master m.1 m.2 ?
master
(after feature branch
was created)
Additional commits in
master m.1 m.2 m.3 ?
both master & feature
branch after feature
branch was created
Additional (merge)
commit is created in
master branch
feature m.1 m.2 f.1 f.2
Master & Feature – Rebase
Merge
Rebase Cherry-Pick
(non fast-forward)
git reflog A log of all project changes made including deleted commits
git rebase Change the base (i.e. the parent commit) of commits in another branch
Copy commit including the changes made only in this commit as HEAD to
git cherry-pick
other branch
Understanding GitHub
What is GitHub?
git push
git pull
git push
git pull
git merge
git fetch
Remote Branch
master master
(“origin“ repository)
Remote repository‘s name (“origin“) and branch name must always be added
Branch Types - Overview
Tracking Branch
git fetch
Remote-
git pull/push origin branch
Tracking
Congratulations!
Tracking &
Commits & Branches Rebase
Upstreams