Archive for the tag 'git'

git-ftp.sh: Pushing changed files to a website via FTP

I scripted a small but useful shell tool named git-ftp.sh licensed under GPL v3 helps you saving time while pushing changed files to a ftp server. It uses git to find out which files have been changed since the last upload.

If you have multiple branches, which is very common with git, it also finds changed files between those branches. It also deletes files on ftp server which were deleted in the local git repo. It does only upload and delete git tracked files.

Some more features:

  • Option -D: dry-run, so you can see what would happen
  • Option -a: Forces to upload all files
  • Option -i: Enter the FTP password interactively
  • Shows a warning if you are not on master branch

Let’s have a look at git-ftp.sh in action:

git-send-bugzilla: Attach patches to a bugzilla bug

git-send-bugzilla [1] attaches each commit between and to the bug on GNOME’s bugzilla. If .. is not specified, the head of the current working tree is implied.

If -n (or bugzilla.numbered in the repository configuration) is specified, instead of “[PATCH] Subject”, the first line is formatted as “[n/m] Subject”.

git-send-bugzilla is not limited on GNOME’s bugzilla, but was made for it. It is written in Perl.

[1] http://git.collabora.co.uk/?p=user/cassidy/git-bugzilla

GitHub Issue Tracker

GitHub the social coding platform does now have a sipmple Issue Tracker which nicely work together with Git commit messages.

And then:

A lot of people were excited about the Issues release yesterday, but many asked for an API [1] for it. Because we love you all and you’re so good to us, we released one for you.

Whow! The GitHub coders really know how to make people exited!

[1] http://develop.github.com/

GitX: GUI for GIT on Mac OS X

gitx

GitX [1] is a git GUI specifically for Mac OS X. It currently features a history viewer much like gitk and a commit GUI like git gui. But then in silky smooth OS X style!
Features

  • Detailed history viewer
  • Nice commit GUI
  • Fast
  • Nice Aqua interface
  • Paste commits to gist.github.com
  • Explore tree of any revision
  • QuickLook integration

Requirements

GitX is made specifically for Mac OS X 10.5 and higher. Because it uses features like Garbage Collection, you can’t compile it on earlier systems. GitX also requires a fairly recent Git — version 1.5.4 and higher are all supported.

GitX is an open source project. This means that you can help developing or even take the code and develop you own version. GitX is released under a GPL v2 license.

[1] http://git-scm.com/

Git Cheat sheet: For your daily git work

The SVG is at:
http://ktown.kde.org/~zrusin/git/git-cheat-sheet.svg
Sample png’s are here:
http://ktown.kde.org/~zrusin/git/git-cheat-sheet-medium.png
http://ktown.kde.org/~zrusin/git/git-cheat-sheet-large.png

GIT: Make automated releases and daily snapshots

If you like to make automated snapshots and releases of the latest tagged version of your git repo, try the following bash script. It also generates a sha1sum and a md5sum file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
DEST_DIR=/var/www/example.com/downloads/myproject
GIT_DIR=/var/cache/git/myproject.git
(
cd $GIT_DIR;
git archive --format=tar HEAD | gzip > ${DEST_DIR}/daily-snapshot.tar.gz
latest_tag=`git-tag | tail -n 1`;
if [ ! -f "${DEST_DIR}/${latest_tag}.tar.gz" ]
then
git archive --format=tar $latest_tag | gzip > ${DEST_DIR}/${latest_tag}.tar.gz
git-log > ${DEST_DIR}/changelog.txt
fi
cd $DEST_DIR;
echo "" > ./md5sums.txt;
ls -a *.tar.gz | xargs md5sum >> ./md5sums.txt;
echo "" > ./sha1sums.txt;
ls -a *.tar.gz | xargs sha1sum >> ./sha1sums.txt;
)

GIT: Useful Scripts

Need some useful and handy scripts for your daily git work? See this http://github.com/jwiegley/git-scripts/tree/master

Kenai.com soon with git?

Everybody has heard about Sun’s new code forge platform Project Kenai [1]. Kenai provides two diffrents SCM systems: SVN and Mercurial. But this seems not to be enought, the community asks for GIT [2].

[1] http://kenai.com/
[2] http://kenai.uservoice.com/pages/general

GIT: Convert a SVN into GIT repo

If you like to convert your SVN repo into a GIT bare repo, it is simple like that. I normally just take the trunk directory of the SVN repo:

git-svn clone <url>/trunk /tmp/git-temp
git clone --bare /tmp/git-temp /pub/scm/<yourproject>.git
rm -rf /tmp/git-temp

Why SVN sucks

I started using SCM with Subversion (SVN) [1] years ago and was quite happy with it. There were some quirks like:

  • the .svn directory in every directory
  • branching is in most cases senseless, it starts a complete new independent tree. You can not really merge! (See also “Subversion merge reintegrate” [2])
  • I like to develop my projects in the train, airplane, parks, restaurants. But SVN must have network support if you want commit. Of course you can install SVN locally and commit to there but what about other team members? It makes more troubles than anything else… So i just made huge commits most of the time.

but I said to myself, you will not find a piece of software which fits into my needs, right?

Few weeks ago, I found speeches [3][4] of GIT by Linus and Schwartz on Youtube . And it seemed GIT solved every issue i had with SVN. After that I looked deeper into GIT [5] and was amazed:

  • It is so fast
  • Uses only flat files
  • Branching and merging is a cheap action! You can make as much branches of your master as you want, you actually make a new branch for every feature or experimental work you develop. You commit into this branch and nobody sees, because it is local. After finished you just merge into your master branch or you delete the experimental work. EASY!
  • Only one .git directory, so a rm -rf .git in the project root removes GIT versioning.
  • It can interact as a SVN client with git-svn. So you will be able to commit into git in your local branch, merge and commit to SVN remote. But there is no need at all to have a centralized SVN repository, you will be able to have a public GIT repository.
  • GnuPG support (for your web of trust)
  • Actually i didn’t find any quirks, it just fits!

I wonder why so many open source project still using SVN? Maybe they use GIT as SVN client or they just don’t know better.
[1] http://subversion.tigris.org/
[2] http://blogs.open.collab.net/svn/2008/07/subversion-merg.html
[3] http://www.youtube.com/watch?v=4XpnKHJAok8
[4] http://www.youtube.com/watch?v=8dhZ9BXQgc4
[5] http://git.or.cz/

Next Page »