༼ つ ◕_◕ ༽つ Ich will ein git-ninjä sein!
Jeder Snapshot/commit hat eine Referenz auf den Vorherigen. Zusätzlich gibt es Branches und einen HEAD. Branches zeigen auf einen Commit.
$ git remote add upstream https://github.com/metachris/metalab-git-workshop.git
$ git pull upstream master:master # Damit pulle ich den master in den master-branch oder auch fetch+merge
$ git remote -v # Zeigt alle remotes aus .git/config?
$ git fetch # fetch saugt sich alles,
$ git pull # pull merged automatisch - kann im konflikt mit lokalen commits sein
$ cat .git/HEAD # verweist auf .git/refs/heads/ ein commit wird anhand eines SHA-Hashes identifiziert, ein commit ist ein snapshot
$ git branch -av # list (-a) all branches, be (-v) verbose
$ git checkout upstream/master -b upstream
$ git help merge # help/man-page to merge
$ git log # logs are your friend :)
$ git diff $hash # insert $hash
$ git push origin master # not sure which is remote git remote -av
$ git tag <name> # creates a tag
$ git push --tags # creates release on github
- Pro Git Book
- regarding kinds of distributed workflows
- Syncing a fork
- Closing Issues vs. commit messages
- Funny git aliases(doge meme)
- Free github upgrade for students
- zsh aliases for git
- generating git man-pages
- interactive git branching
- hackers guide to git + comments
- Git from bottom up
- Git from the bits up
- Git branching model
# Possibly useful Git aliases for your ~/.bashrc or ~/.bash_profile
alias g='git'
alias gs='git status | more' #maybe not so useful on linux(postscript)
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gcnv="git commit --no-verify" # code-style checks pep8 on python(style-guide), git hooks überspringen
alias gd='git diff'
alias go='git checkout '
alias gl='git log' #git pull on zsh with oh-my-zsh and git-plugin enabled
alias gh='git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short'
alias gr='git remote' # grrrrrrr
- gitk - git history als tolles GUI
- git cola - staging tool, also on linux
- gerrit
- Kaleidoscope App -- OS X git difftool, sonst verwendet er meisten git diff und git merge
- Linux users could try Meld Diff viewer (2 and 3-way diff and merging, support for GIT and other version control systems)
- Manage /etc with git -- etckeeper
- bup
/etc/gitconfig
,~/.gitconfig
,.git/config
$ git config --list
$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]
$ git config --global core.editor emacs
$ git config --global merge.tool vimdiff
- Getting Help
* `$ git help <verb>`
* `$ git <verb> --help`
* `$ man git-<verb>`
function git-branch-name {
git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3
}
function git-branch-prompt {
local branch=git-branch-name
if [ $branch ]; then printf " [%s]"
If you want a more advanced prompt, you might enjoy this: https://github.com/nojhan/liquidprompt
Fragen & Feedback
-----------------
* Gibt's bei großen Gruppen Alternativen zur Torvalds Methode?
(Ich merge nichts was ich fixen muss)
* what does git rebase do?
* whats "git stash"
* saves local changes, so that you can change to different branch without commit
* how do you mange your .dotfiles with git? static links?
* ln -s /path/to/git/repo/.bashrc /home/user/.bashrc
* if you do this for global (root) files, you need to fix the permissions
* commit messages? What should I write into them
* What did you change since the last commit?
* Good commit message: Fixed issues with the flux capacitor)
* BAD commit message: Added some code
* ive once read a guide that you should use the same verbs or something. Are there any commit guides? As far I understood you want to find commits as fast as possible :>
* Some tips [Information in commit messages](https://wiki.openstack.org/wiki/GitCommitMessages), [2](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message)
* i'm really new to git so you're a little bit fast for me but as long as you answering questions inbetween i can catch up :)
Training Repos
--------------
* [Sonnenblende für Laptops](http://github.com/norpol/xanto)
* [Testing Repo](https://github.com/metachris/metalab-git-workshop)