git - distributed version control system

git is a distributed version control software written by Linus Torvalds.

If you get git permissions error

error: unable to create temporary sha1 filename ./objects/19: File exists

The problem might be with file permissions. To fix:

sudo chown -R user:user .
sudo chgrp -R user

in the git repo directory.

QuickRef

Log changes to a file, starting with A:

git --no-pager log --date=short  --pretty=tformat:"%s %h | %cn | %ad "  servers.md  | grep \^A

Note: above can be extended to automatically print TeX formatted table for document revision.

Creating a new repo:

mkdir free_monkey
cd free_monkey
git init
git remote add origin git@YOUR_SERVER_HOSTNAME:free_monkey.git
# do some work, git add and commit files
git push origin master:refs/heads/master

Checking out a tag, (in this case version 1.1.0 of couchdb from github):

git clone https://github.com/apache/couchdb.git
git checkout 1.1.0 -b v1.1.0

Git reference

Self hosting

If you want to host git for yourself and your team on your server/inside the company firewall, these are some of the options

sr.ht - software hosting for hackers

gitlab – written in ruby. closes to github in terms of UI. Likely to be a resource hog (ruby!). requires installation of quite a few ruby libraries to get it going. Or you could use a virtual machine that has everything builti in.

gitblit – written in Java. Integrates with LDAP, redmin, windows auth, PAM etc., Perhaps the best suited for “enterprise” installations. Easy to install, download one file (war or jar) and you are good to go.

gitbucket – another github “clone” written in Scala. Easy to install.


Contributing a patch to a git repo that doesn’t have “web pull request” interface: source


>easier contributing

Er... what? What's hard about contributing? You don't have to go
through a web interface for everything? IMHO that makes it easier.

    $ git clone git://c9x.me/ed.git
    
    $ git format-patch --cover-letter  
    
    $ git send-email 

`man git send-email` will tell you anything you need to know:
configuration options, examples... If is well-written and
straightforward! Seems like the author isn't interested in public
issue tracking (yet), and using Github wouldn't have changed that.

I, for one, celebrate that he's not using Github. I'm very afraid of
the git == github trend I'm seeing amongst many people (technically
semi-literate or even technical people)

Tips and tutorials

Clients