mkdir, rm/del) 1.1. bash/csh/zsh/*sh for *nix 1.2. cmd/power shell/cygwin/mygwin for Windows 2. git installed and available in the PATH 3. git properly configured (more on that later) 4. version 1.9 or later… (Use 2.x on *nix)
- random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronounciation of "get" may or may not be relevant.
pick from the dictionary of slang. - "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room. - "goddamn idiotic truckload of sh*t": when it breaks Initial revision of "git", the information manager from hell https://github.com/git/git/commit/e83c5163316f89bfbde7d9ab23ca2e25604af290
comes with it’s own jargon. git folder: .git directory at the root of the project. Holds everything git needs to keep track of (file oriented database). git command: git offers commands. it’s the first arguement in the CLI. (git help) Object: a record (file) in the database. Referenced by its hash (SHA-1) Blob: an object that contains data (text or binary). Tree: an object that represents a structure of blob(s) (name of the files). Commit: an object that links a new tree to a parent commit and a message.
HEAD: Pointer to the current (often the last) commit the index points to. Branch: Pointer to the current tree on which the index operates. Master branch: The “default” or “main” branch, typically called master Feature branch: One of the best practice is to isolate changes into seperate branches, called feature branches. “Feature” can also mean bug fix here. Tag: Name/synonym for a commit (commit-ish or ref, see git rev-parse). Anotated tag: shareable, persistant and signable tag.
emac, nano, notepad…) should show up… git needs a commit message. First line: Commit title (80 chars max for Linus) Second line: Empty. Third+: Commit message on multiple lines
branch, i.e. apply our commits after what’s new in master git checkout <feature-branch> git rebase <base-branch> # “inserts” all things # in base-branch before feature
&& git commit 2. Abort try other strategy (see git help merge) 3. Abort and try interactive rebase (git rebase -i <commit-ish>) Finding regression: git bisect
to add at least one remote to your your git repo. Remotes are “remotes working copies” They can be anywhere: on your friend’s laptop or on github/gilab/bitbucket/your own server
<remote-name>/<branch-name> Let’s say we are in the master branch and want to update it to our local copy of the remote’s version: git merge origin/master
acces to the repro, you can push to any branch (as long as it does not already exist) git push origin master # pushes the current # branch into origin/master
forced update or else git with yell at you. git push <remote-name> <branch-name> --force Never do this on the master branch: git pull won’t work. (way out: git checkout <lastest-common-commit-ish>)
git pull origin master # makes sure local master is sync git checkout -b my-feature # creates new feature branch … git commit -a [-m “”] # x times git push origin my-feature # on another computer, we do the “release” (or integration) git checkout master git pull origin my-feature git push origin master git tag -a 1.0.1a -m ‘My feature’ # optional, but recommanded git push --tags # this is how you push anotated tags
Forks: Let’s you create a remote copy of a read-only git project on which you will have read+write access. 2. Pull Requests (PR): Ask the owner of the project to git pull changes in your feature branch from your remote without any setup! https://guides.github.com/introduction/flow/ Github workflow
email. (see git format-patch and git apply) - PR also works across your own branches! You can also add more commits to a PR by pushing more! - They are a great way to review code. Elect a leader for merges in master. - Integrated as a github issue == awesome emojis - git pull origin pull/<id>/head Github workflow - Pull Requests
tortoisegit: https://code.google. com/p/tortoisegit/ dotfiles: the CLI is your friend, don’t let it suck http://dotfiles.github.io/ Google/StackOverflow: “git how to…”
Linus personal computer. He pulls from 5 other guys he trusts. They trust other people who trusts other people. But Linus can always be sure that his copy is intact since everything is hashed.