Piku’s Blog

June 13, 2008

Git trick

Filed under: Git — Tags: , , — Mihai @ 11:11 pm

A friend asked me about an error he had while trying ‘git pull, it was saying that file X was not uptodate.

For git pull (actually for merge) you need to not have anything uncommited (either commit or reset). But he did not wanted to commit because he didn’t finished working neither reset because he would lose his work.

There is another way, git stash: Git stash saves your modifications away and gives you a clean working dir. Use ‘git stash <optional name>‘ to create a stash. With ‘git stash list‘ you can view your stashes, ‘git stash show <name>‘ to view a specific stash and ‘git stash apply <name>‘ to apply it.

In his case he needed to run:

git stash work
git pull
git apply work
Advertisement

May 3, 2008

Compiling git with documentation

Filed under: Git — Tags: , , , , , , , — Mihai @ 3:34 pm

I have previously posted how to compile git on Ubuntu but while using git I wanted to consulte the manual to get information about some commands and git help didn’t work. It seems that you have to manually specify when compiling that you want to have documentation included too.

Here’s how to do that. Go to the directory where you have unarchived git sources and type:

make doc
sudo make install-doc

You can also combine them when you compile git:

make all doc
sudo make install install-doc

May 1, 2008

Braid 0.4

Filed under: Git, News, Ruby on Rails, Uncategorized — Tags: , , , , , , — Mihai @ 2:10 pm

Braid 0.4 has been released, Braid is a simple tool to help track git and svn vendor branches in a git repository. I had a previous coverage of Braid 0.3.

The new features include squashed mode, in which you have only one commit when adding a mirror instead of having all the history and a team mode. It also requires Git version 1.5.4.5 or higher (see my post on updating git). If you hit any bug please report them.

The wiki has usage and examples. You can install it with rubygems (don’t forget to upgrade to RubyGems 1.1.1):

gem sources -a http://gems.github.com/
gem install evilchelu-braid

Or you can get it from the Git repository.

If you used my previous Braid tutorial here’s how to upgrade Rspec to the git repository and get the latest version. If you do not have rspec svn setup you can skip this part.

braid remove vendor/plugins/rspec
braid remove vendor/plugins/rspec_on_rails
git merge braid/track

I think I hit a bug and had to delete the folders manually:

 rm -rf vendor/plugins/rspec vendor/plugins/rspec_on_rails

Now to install the git repositories:

braid add -p -t git git://github.com/dchelimsky/rspec.git
braid add -p -t git git://github.com/dchelimsky/rspec-rails.git
git merge braid/track

April 14, 2008

Updating git on ubuntu

Filed under: Git — Tags: , , , , , — Mihai @ 8:53 pm

Updated with the latest git release 1.5.5.1

I am using Ubuntu 7.10 Gutsy and use git a lot, the latest version in gutsy repository is 1.5.2.5 but the latest version of Git is 1.5.5.1 so here’s a quick tip for compiling git.

First remove git if you have installed it from repositories:
sudo apt-get remove git git-svn

Then go into a temporary folder where you will download and compile git:
wget http://kernel.org/pub/software/scm/git/git-1.5.5.1.tar.bz2
sudo apt-get build-dep git-core
tar xjf git-1.5.5.1.tar.bz2
cd git-1.5.5.1/
./configure
make
sudo make install

If you have a dual core CPU and want to use them both to compile faster use make -j2 instead of make

Now enjoy your hand compiled git 🙂

PS: For git gui I had to to install tk (sudo apt-get install tk).

February 14, 2008

Braid updated to 0.3

Filed under: Git, Ruby on Rails — Tags: , , , , — Mihai @ 4:45 pm

Braid has been refactored and now supports svn and git, it uses merge-subtree for git repositories and git-svn to track svn repositories. The meta information format has been changed too, now uses YAML::Store

Version 0.3.2 is the latest currently released, it now fetches only HEAD  revision instead of mirroring the whole repository.

The commands has been changed, I have updated my guide on installing rspec with braid.

You can also see the usage with ‘braid help’.

Older Posts »

Create a free website or blog at WordPress.com.