Git For Beginners Handout
Git For Beginners Handout
This tutorial is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 France License
1 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Objectives
2 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Summary
2. Overview of GIT
3. Working locally
6. Administrating a server
7. Extras
3 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Part 1.
About Version Control Tools
• Definition
• Use cases
• Base concepts
• History
4 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
From: http://en.wikipedia.org/wiki/Revision_control
5 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
1
let’s say your not happy with your latest changes
2
this is useful for understanding and fixing bugs
6 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
7 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
• a main branch
• a maintainance branch (to provide bugfixes in older releases)
• a development branch (to make disruptive changes)
• a release branch (to freeze code before a new release)
8 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
3
decentralised tools only
9 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
4
source: the Linux Foundation
10 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Some illustrations
11 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Taxinomy
Architecture:
Concurrency model:
History layout:
13 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
14 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
14 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
14 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
14 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
14 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
14 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
• commit often
16 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
17 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
18 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Part 2.
Overview of GIT
• History
• Git’s design & features
• User interfaces
19 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
History
5
now open source! (since 2016)
20 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
• ease of use
21 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
• Integrity
• cryptographic tracking of history (SHA-1 hashes)
• tag signatures (GPG)
• Merging
• pluggable merge strategies
• staging area (index)
• Performance
• no delta encoding
22 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Git Commands
23 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
24 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
25 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
26 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Part 3.
Working locally
• creating a repository
• adding & committing files
• the staging area (or index)
27 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
29 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
• the repository
(the whole history of your project)
30 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
31 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Update a file
$ echo 'blah blah blah' >> hello
$ git commit
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: hello
#
no changes added to commit (use "git add" and/or "git commit -a")
32 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
This command commits files (or dirs) directly from the working
tree
7
also named “partial commit”
33 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
34 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Deleting files
git rm file
→ remove the file from the index and from the working copy
git commit
→ commit the index
$ git rm hello
rm 'hello'
$ git commit -m "removed hello"
[master 848d8be] removed hello
1 files changed, 0 insertions(+), 3 deletions(-)
delete mode 100644 hello
35 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Showing differences
git diff [ rev a [ rev b ] ] [ -- path . . . ]
36 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
37 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Diff example
$ echo foo >> hello
$ git add hello
$ echo bar >> hello
$ git diff
--- a/hello
+++ b/hello
@@ -1,2 +1,3 @@
Hello World!
foo
+bar
Resetting changes
git reset cancels the changes in the index (and possibly in the
working copy)
• git reset drops the changes staged into the index8 , but the
working copy is left intact
• git reset --hard drops all the changes in the index and in
the working copy
8
it restores the files as they were in the last commit
39 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
40 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
9
note that git mv is strictly equivalent to: “cp src dst && git rm src &&
git add dst” (file renaming is not handled formally, but heuristically)
41 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Exercises
1. create a new repository
3. launch gitk to display it. Keep the window open and hit F5 after each
command (to visualise the results of your commands)
5. rename the file (either with git mv or git add+git rm), do a git status
before committing (to ensure the renaming is correctly handled)
7. create two new files and commit them. Then modify their content in the
working copy and display the changes with git diff
8. add one file into the index but keep the other one. Display the changes
between:
• the index and the working copy
• the last commit and the index
• the last commit and the working copy
10. run git reset --hard to reset the index and the working copy
42 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Part 4.
Branching & merging
• How GIT handles its history
• Creating new branches
• Merging & resolving conflicts
43 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
44 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
45 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
46 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Note: it may fail when the working copy is not clean. Add -m to
request merging your local changes into the destination branch.
$ git checkout master
error: Your local changes to the following files would be overwritten by checkout: hello
Please, commit your changes or stash them before you can switch branches.
Aborting
$ git checkout -m master
M hello
Switched to branch 'master'
47 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Merging a branch
This will merge the changes in other branch into the current
branch.
$ git status
# On branch master
nothing to commit (working directory clean)
$ git merge develop
Merge made by recursive.
dev | 1 +
hello | 4 +++-
2 files changed, 4 insertions(+), 1 deletions(-)
create mode 100644 dev
48 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
• git merge applies only the changes since the last common
ancestor in the other branch.
→ if the branch was already merged previously, then only the
changes since the last merge will be merged.
49 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Branching example
50 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Merge conflicts
In case of a conflict:
10
Git will refuse to commit the new revision until all the conflicts are
explicitely resolved by the user
52 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Resolving conflicts
Then, once all conflicting files are checked in the index, you just
need to run git commit to commit the merge.
53 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Conflict example
54 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Conflict example
54 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Conflict example
54 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Conflict example
54 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Conflict example
54 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Conflict example
54 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Conflict example
54 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Conflict example
54 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Deleting branches
git branch -d branch name
Exercises
0. use “gitk --all” to display all branches
(and remember to hit F5 after each command to visualise the changes)
56 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Part 5.
Interacting with a remote
repository
• Overview
• Creating a shared repository
• Configuring a remote repository
• Sending changes (push)
• Receiving changes (pull)
57 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Team Workflow
58 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Team Workflow
58 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Team Workflow
58 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Team Workflow
58 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Team Workflow
58 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Team Workflow
58 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Team Workflow
58 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Team Workflow
58 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Team Workflow
58 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
59 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
12
default name used by git clone
60 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Examples:
$ git remote add origin /tmp/helloworld.git
61 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
• In case of conflict git push will fail and require to run git
pull first
62 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
git fetch
64 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
git pull
$ git pull
65 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Remote example
66 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
If the branch name does not exist locally, then GIT looks for it in
the remote repositories. If it finds it, then it creates the local
branch and configures it to track the remote branch.
$ git branch --all
* master
remotes/origin/master
remotes/origin/new-fancy-feature
$ git checkout new-fancy-feature
Branch new-fancy-feature set up to track remote branch new-fancy-feature from origin.
Switched to a new branch 'new-fancy-feature'
$ git branch --all
master
* new-fancy-feature
remotes/origin/master
remotes/origin/new-fancy-feature
67 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Cloning a repository
• In practice you will rarely use git init, git remote and
git fetch directly, but rather use higher-level commands:
git clone and git pull.
68 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Typical Workflow
69 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Exercises
3. make some commits and synchronise (pull/push) with the origin repository
6. create a new branch, make a commit and publish it to the shared repository
70 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Part 6.
Administrating a server
• Shared repositories
• GIT servers
• Available protocols
71 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
72 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Admin Considerations
Administrating a GIT server is relatively simple14
• no partial access
(access is granted to the full repository)
• Local access
→ /path/to/the/repository.git
74 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
• HTTP/HTTPS server
• firewall friendly
• many authentication methods (provided by the HTTP server)
• can provide SSL encryption, even for anonymous users
→ http://[email protected]/path/to/the/repository.git
75 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
GIT-centric forges
• Hosting only
• GitHub
https://github.com/
• BitBucket
https://bitbucket.com/
• Google Code
https://code.google.com/
• Gitorious
http://gitorious.org
76 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Part 7.
Working with third-party
contributors
• Common workflows
• Generating & applying patches
• Merging from third-party repositories
77 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Common workflows
78 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
15
developers who are not allowed to push to the official repository
79 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Generating patches
• git diff
The basic (prehistoric) way: use git diff
• git format-patch
The modern way: git format-patch converts you history
(commits) into a series of patches (on file per commit) and it
records the metadata (author name, commit message) 16
16
Note: git format-patch does not preserve merge history & conflicts
resolution. You should only use it when your history is linear.
80 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Generating patches
Example:
$ git format-patch origin/master
0001-added-foo.patch
0002-removed-bar.patch
81 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Applying patches
17
am originally stands for “apply mailbox”
18
actually GIT distinguishes between the author and the committer of a
revision (usually they refer to the same person, but not when running git am)
82 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Explicit pull/push
→ merge the remote branch from the repository url into the
current local branch
83 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Decentralised workflow
84 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Decentralised workflow
84 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Decentralised workflow
84 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Decentralised workflow
84 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Decentralised workflow
84 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Decentralised workflow
84 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Decentralised workflow
84 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Decentralised workflow
84 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Decentralised workflow
84 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Decentralised workflow
84 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Decentralised workflow
84 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
→ fetch the branch branch from the repository url and store it
temporarily19 as FETCH HEAD
$ git fetch git://git.raoul-duke.org/helloworld.git master
From git://git.raoul-duke.org/helloworld.git
* branch master -> FETCH_HEAD
$ gitk FETCH_HEAD
...review the commits ...
$ git merge FETCH_HEAD
19
the FETCH HEAD ref remains valid until the next time git fetch is run
85 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
86 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Exercises
0. (reminder: use gitk --all)
1. associate with your neighbour and distribute roles: one is the developer and the
other one the external contributor
2. (developer) ssh to allgo.inria.fr and create your own bare repository inside
/git/ (use --shared=0755 to make it read-only for others)
3. (developer) clone your repository on your local machine, make some commits
and push them
5. (contributor) convert your commits into patches and send them to the developer
7. (contributor) pull the latest changes and check that your patches are applied
10. (developer) pull the commits from the unofficial repository and push them to
your repository
87 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Part 8.
Extras
• Some advices
• Common traps
• Documentation
• Next tutorial
88 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
89 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
90 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
• git reset reverts the index, but keeps the working copy
unchanged
→ do git reset --hard if you need to revert the working
copy too
91 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
• GIT is not forgiving, do not ignore its warnings and do not use
--force unless you have a clear idea of what you are doing
92 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
93 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
93 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
93 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
93 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
93 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
94 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Further documentation
• man git cmd (tough & exhaustive)
• man gitglossary
• The Git book
http://git-scm.com/book
https://www.atlassian.com/git/workflows
95 / 96
Version Control GIT Intro Local GIT Branches Remote GIT Server Bazar Extras
Next tutorial
• git internals
96 / 96