Skip to content
Snippets Groups Projects
Commit f2f2b932 authored by Sivecano's avatar Sivecano
Browse files

talk done and pdf

parent 14f6781c
No related branches found
No related tags found
No related merge requests found
......@@ -32,15 +32,44 @@ title: Git and Gitlab
That's why you're here!
# Basic Concepts
##
\bigtext{Basic Concepts}
## Terminology
### commit
the smallest unit of change that is recorded into your git database
represents a snapshot of your project this is the smallest unit of change that git records
### branch
a chain of commits under a specific name
### repository
the structure in which git stores your data
the structure in which git stores your data, effectively your project folder
## Repository
\begin{tikzpicture}
\draw[line width=.5pt]
(4, 3) node[draw] {Repository}
(-1,0)node[draw] {main}
(-1,1)node[draw] {auxiliary}
(-1,-1)node[draw] {other}
(0,0)node[draw, circle] (0) {}
(1,0)node[draw, circle] (1) {}
(2,0)node[draw, circle] (2) {}
(3,1)node[draw, circle] (3) {}
(3,0)node[draw, circle] (4) {}
(4,1)node[draw, circle] (5) {}
(4,0)node[draw, circle] (6) {}
(5,0)node[draw, circle] (7) {}
(4,-1)node[draw, circle] (8) {}
(6,0)node[draw, circle] (9) {}
(5,-1)node[draw, circle] (10) {}
[-] (0) -- (1) -- (2) -- (4) -- (6) -- (7) -- (9)
[-] (2) -- (3) -- (5) -- (7)
[-] (4) -- (8) -- (10)
;
\end{tikzpicture}
## States of Git
......@@ -70,11 +99,16 @@ switch your current branch to `master`
### checkout commits
git checkout c1d0e5f
revert all tracked changes to state recorded in the commit
load the snapshot recorded in the commit
> this leaves you in a detached HEAD state
# Using Git
##
\bigtext{Using Git}
## Installing Git
### Git Itself
go to [https://git-scm.org](https://git-scm.org) and follow the instructions.
......@@ -90,8 +124,8 @@ if you try to use git away you'll run into issues. we need to configure it first
omitting the `--global` allows configuration on a per-repo basis
## Basic Commands
> you may want to take notes for this section
##
\bigtext{Basic Commands}
## managing your repo
......@@ -131,6 +165,9 @@ omitting the `--global` allows configuration on a per-repo basis
# Branches
##
\bigtext{Branches}
## what is a branch?
\begin{tikzpicture}
......@@ -345,6 +382,8 @@ advanced:
# Troubleshooting
##
\bigtext{Troubleshooting}
## Stash and Pop
git does not allow to checkout if it would overwrite local changes.
......@@ -370,7 +409,6 @@ when you don't need to push any changes you can also clone with https
https://gitlab.ethz.ch/thealternative/courses.git
## Merge conflicts
Remember from earlier:
......@@ -388,7 +426,14 @@ git adds conflict-resolution markers
resolve these either manually or with `git mergetool`. mark as resolved with `git add`
## Exercises
* make a commit and amend it
* make some changes and stash them to checkout another branch or earlier commit
* clone a repo using https to a different location (try the repo this course is in: https://gitlab.ethz.ch/thealternative/courses.git)
# Best Practices
##
\bigtext{Best Practices}
## Commit Frequency
Commit often but not too often.
......@@ -424,11 +469,15 @@ Commit messages should be short and descriptive.
fixed issue #1
## Branches
Branches are a useful tool both for experimenting with rewrites and new feature or for developing a
different version of your project.
There are multiple strategies for dealing with branches such as a trunk based approach or git flow.
## Exercises
* look at your previous commit messages in the webview. are they any good?
* consider the frequency and content of commits you've made so far. do they seem sensible?
# Advanced Topics
......@@ -461,6 +510,11 @@ example:
\includegraphics[width=\textwidth]{img/tag_issue.png}
## Exercises
* mention an issue in a commit
* install and try git-lfs
* make .gitignore file
# Outlook
## Where to Learn More
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment