Git Starter

Daniel Lauzon
References
Overview
-
Why one uses git
-
Basics
-
Workflow and Collaboration
-
Hands-on (SourceTree)
What is Version Control
- Track changes over time
- Traceability: Who modified what
- Reproducibility
- Branching and merging

Report-2016-06-22-revB-Dan-final-V39
What is Git
- Distributed Version Control
- Performance
- Git is a de-facto standard
Commits




time
commit: Record all files at a point in time
Hands-on
Setting up a new repository
$ git init my-project
Initialized empty repository in my-project/.git/
Cloning a repository
$ git clone ssh://john@example.com /path/to/my-project.git
$ cd my-project
# Start working on the project
Staging
$ git add A.txt.md $ git status On branch master Initial commit Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: A.txt.md
$
Committing
$ git commit -m "My first commit"
[master (root-commit) 605fd93] Adding A file
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 A.txt.md
$
Sync'ing
$ git pull origin
$ git push origin master
What is branching

Collaboration
- Benefits of a Standard Workflow
- Feature branch workflow

Feature Branch Workflow
- Each feature gets a branch
- Keep the master branch clean
- Can share a feature branch
- Minimize conflicts
New Feature

git checkout -b my-feature master
Local commits
git status
git add <some-file>
git commit
Share you work
git push -u origin my-feature
- submit a pull request
Code review

- Someone else reviews your changes
Merging your feature

$ git checkout master
$ git pull
$ git pull origin my-feature
# or git merge my-feature
$ git push
Gitflow Workflow

- Same as feature workflow
- Added Conventions
Historical Branches

Feature Branches

Release Branches

Tools
- git command line
- Atlassian SourceTree
- Git Kraken
- ...
Advanced Topics
- Conflicts
- Rebasing vs Merging
- Git internals (checksum)
Hands On!
Thanks!
Questions?
Git Starter
By daneroo
Git Starter
- 940