Read the git tutorial. You need to at least set up your config variables.
Dear Apple developers, your package management on your OS sucks. Enjoy using darwinports, macports, fink or some other broken unsupported package repository. Otherwise install Arch or Ubuntu and enjoy I real development environment!
You can try install fink, use unstable sources.
Easy: apt-get install git-core
How the WebKit mirror was constructed:
mkdir /srv/git/webkit
cd /srv/git/webkit
nox:/srv/git/webkit% git --bare init --shared
nox:/srv/git/webkit% git --bare fetch git://git.webkit.org/WebKit.git master:master
git fetch -f git://git.webkit.org/WebKit.git master:master # and again later forcing updates
touch git-daemon-export-ok
echo ssh://git.webvm.net/srv/git/$(basename `pwd`) > cloneurl
This could be wrong. Maybe I should have:
git remote add webkit git://git.webkit.org/WebKit.git
git fetch webkit
I posted to the git mailing list to ensure I am doing this right (I am). Unfortunately when you work on a WebKit branch you need make a complete checkout. You really can’t get around that.
/var/cache/git has been split out into private and public:
nox:~% cat /srv/www/git.webvm.net/.htaccess
SetEnv GITWEB_CONFIG /srv/www/git.webvm.net/gitweb.conf
nox:~% egrep 'projectroot =' /srv/www/git.webvm.net/gitweb.conf
$projectroot = "/var/cache/git/public";
nox:~% egrep 'projectroot =' /srv/www/g.webvm.net/gitweb.conf
$projectroot = "/var/cache/git/private";
Setting up projects to be public:
nox:/var/cache/git/public% sudo ln -s /srv/git/backup
nox:/var/cache/git/public% sudo ln -s /srv/git/runtest
Use case: We are working with directfb code base. We need a central location to manage our changes.
The ssh:// URL can be found from the web interface.
As a developer using the code base of an opensource project, you will want to a
seperate branch with: git-checkout -b $BRANCHNAME. Could I please suggest
calling $BRANCHNAME you want people to look at as $USER, though perhaps naming
$BRANCHNAME as a particular feature is wiser.
Create as many branches as you like, though to let people see your work, you
need to push back with git push origin $BRANCHNAME.
Please mail your patches to the usual suspects. Or use git-config
remote.origin.url ssh://git.webvm.net/srv/git/PUBLIC_NAME if you have an ssh
account on ?nox.
git-daemon is setup in /etc/sv/git-daemon/run to allow git:// transport on the public listed projects.
You need an username and password for access. And here you are only able use the ssh:// transport. ssh:// is a little slower than the git:// transport.
git --bare init --shared in a dir called ‘/srv/git/oldsvn’git-svn clone $SVN_URL # svn checkout your subversion repo you want to migrate to gitgit push ssh://example.com/srv/git/oldsvn --allgit init
git add .
git commit -a -m "initial"
git-config remote.origin.url ssh://git.webvm.net/srv/git/runtest
git push --all
Git has a bit of a steep learning curve. Please add you findings below:
git log --pretty=oneline | head -n1?git-rev-parse HEADgit checkout -b wherethingswereworking 838a74bbf47c7109a22c2fd679f410ddeb3bcd74git-branch -agit fetch origin and then a git merge origingit clean -dgit branch -a # to find name of $remote
git checkout -b $remote origin/$remote
git show 08762e852c49709a22ef8fd9c82bb6a6b28ed91b
git rm -f --cached private/personal/health.txt
git commit --amend
git commit to be more like svn commit?With git, commiting changes should require a git add file and then a git
commit. Most people get around this boring default behaviour by issuing git
commit -a all the time. But if you can’t be bothered to type in a “-a” switch
all the time, create an alias with in your ~/.gitconfig, like so:
git config --global alias.ci 'commit -a'
Then svn style svn ci should work for committing:
git ci
git-mergetool -t vimdiff
It’s a bit scary. Try understand how everything works in a test repo… git init in /tmp/foo and go from there.
See this Git CVS workflow tutorial.
svn revert a single file “platform.html”?git checkout platform.html
git revert HEAD
SOURCE: http://book.git-scm.com/4_undoing_in_git_-_reset,_checkout_and_revert.html
To see the paths:
git-status
Notice the odd ‘—’
x61:~% git reset -- aplix/code/trunk/tests/html/logs/index.cgi
rm -fr .git
git init
You could just use a tar --exclude-vcs -cf src.tar src/ line to skip the .git directory
git diff --color-words --no-index foo bar
Also see http://stackoverflow.com/questions/2013091/coloured-diff-to-html
error: hooks/post-receive exited with error code 75
sudo apt-get --reinstall install git-core