3. A Free and open source distributed
version control system designed to
handle everything from small to very
large projects with speed and efficiency.
Created by Linus Torvalds.
4. If you are not distributed, you
are not worth using
Linus Torvalds
5. If you perform badly, you are not
worth using
Linus Torvalds
6. If you cannot guarantee that
what I check in, checks out
exactly the same way, you are
not worth using
Linus Torvalds
7.
8.
9.
10. • Distributed: no need to access a central server in order to use
version control. Every revision is tracked locally. Every Git workspace is a full
blown version control system
• Offline: users can commit/diff and do everything offline
• Merging and Branching: core of Git. Performant
• Fault-tolerant: no single point of failure
11. • You cannot do partial checkouts (partial clones)
• Windows support is not as great as other for OS.
• No “latest version”. Git uses hashes which are unreadable for humans
• No global revision numbers.
13. • Everyone has a local sandbox, you have your own copy of the repo
• It works offline
• It’s fast, performance built from the core
• It handles changes well, branching and merging is core
• Does not track empty folders
14. – Status = working tree status
– Push = update remote refs + objs
– Fetch = download remote refs + objs
– pull = fetch + merge
– Init = create empty git repo
– Commit = record changes to repo
– Add = add to index
– Diff = show changes between commits and working directories
– Merge = join 2+ dev histories
– Clone = gives you a complete copy of that repo on your system
– Branch = list/create/delete branches
– Tag = list/create/delete tags
…and much more
19. # Add command aliases to facilitate day to day routines.
# Single command:
> git config --global alias.alias command
# User’s directory, create “.gitconfig” file. Example:
[alias]
ac = !git add -A && git commit
# To verify:
> git config --list
20. # Github does not support direct shell access
# Must use the Github api:
> curl -u ’<username>' https://api.github.com/user/repos -d '{"name":”<repo-name>"}’
# Set up SSH keys with github, then:
> git remote add origin git@github.com:<username>/<rep-name>.git
> git push –u origin master ## requires SSH to be added
21. • On fork1 make change and push to master branch
• Before merging in fork2, make a change on same line, commit it, and try
to push to master -> rejected
• Try git pull
• To view change: git diff HEAD
• Resolve merge with git mergetool (opendiff) -> pick change in fork2
• Power command: git ac “Resolve conflict”
• Use git config --global mergetool.keepBackup false to remove .orig files
or add them to .gitignore
• git pull on fork1 and merge changes