http://www.kernel.org/pub/software/scm/git/docs/howto/setup-git-server-over-http.txt
Google Tech Talks (Randal Schwarz): https://www.youtube.com/watch?v=8dhZ9BXQgc4
[alias]
graph = log --graph --pretty=format:'%Cred%h%Creset-%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %C(bold blue)`<%an>`%Creset' --abbrev-commit --date=relative
daily = log --since '2 days ago' --oneline
Undo all local Modifications
Checkin Modifications
List all Branches
Change current Branch
Obtain diff between current Branch and master Branch
Merge Branches into another
Initialize ‘’bare’’ repository:
Configure repository for push:
Start server:
# set up new project
cd project
git init
git add .
git commit -a -m "Initial commit"
# edit a file
vi file.php
git commit -a
# add a file
vi new.php
git add new.php
git commit -a
# see the log
git log
# make a branch
git branch working
git checkout working
# or in one step
git checkout -b working
# add some changes to this branch
vi file.php
# see what you changed
git status
# check it in
git commit -a
# see all branches
git branch
# go back to the first branch (initial branch is called "master" by default)
git checkout master
# make some other changes
vi other.php
git commit -a
# merge the working branch into this one
git merge working
# see the branches and merges in a graphical browser
gitk --all
# let's do a log of all commits in "working" that don't exist in "master"
git log master..working
# hmm let's undo that last merge (tip of branch is HEAD, one commit back is HEAD^.. we are "popping" one commit)
git reset --hard HEAD^
# push your changes out (push the tip of local "master" branch to remote "incoming" branch)
git push foo.bar.com:~/myrepo master:incoming
# pull changes from another repo (remote "feature1" into local "feature1" branch)
git pull baz.bar.com:~/otherrepo feature1
# move the branch point of the "working" branch to the top of the "master" branch
git checkout working
git rebase master