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 apply work
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:
sudo make install-doc
You can also combine them when you compile git:
make all doc
sudo make install install-doc
Updated with the latest git release 220.127.116.11
I am using Ubuntu 7.10 Gutsy and use git a lot, the latest version in gutsy repository is 18.104.22.168 but the latest version of Git is 22.214.171.124 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:
sudo apt-get build-dep git-core
tar xjf git-126.96.36.199.tar.bz2
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).