Using git – Part II

Well I can say I’m very happy with git. I actually use it now too to maintain this blog, not the posts them self but the layout, additional plugins etc. While doing this I ran into something odd.
Maybe a little bit of an explanation on how it’s et up right now. I have a main repository folder and a working repository, maybe it’s not the ideal situation but that’s the way it is.
Whenever I make changes I can check them locally as the working folder is also the folder for my local Apache, so I can see changes while I’m working. When satisfied I push the working repository and I update my remote website from the main repository, at least that’s the way I wanted it to work.
The first time I made changes I pushed them out and uploaded the folder to my remote website with FTP. I checked the remote website and the changes I made weren’t there. So I checked my local testsite and sure enough the changes were there. I pulled the main repository and it said everything was up to date, I pushed again and the same reply, everything is up to date. OK, now I’m confused. I checked the changed file in my working folder and the changes were there but when I checked the same file in the main repository folder and the changes weren’t there! What was happening? A git-status in the main repository showed the changes I pushed earlier weren’t committed. Time to search the Internet πŸ™‚

The FAQ on the git website gave me the answer:

Why won’t I see changes in the remote repo after “git push”
The push operation is always about propagating the repository history and updating the refs, and never touches working tree files. Especially, if you push to update the branch that is checked out in a remote repository, you will not see the files in the work tree updated. This is a conscious design decision. The remote repository’s work tree may have local changes, and there is no way for you, who is pushing into the remote repository, to resolve conflicts between the changes you are pushing and the work tree has. However, you can easily make a post-update hook to updating the working copy of the checked out branch. The main problem with consensus of making this a default example hook is that they only notify the person doing the pushing if there was a problem. (see or the earlier, more easily cut-able  and past-able version A quick rule of thumb is to never push into a repository that has a work tree attached to it, until you know what you are doing. See also the entry (How would I use “git push” to sync out of a firewalled host?) in this FAQ for proper way to work with push with a repository with a work tree.

Ok, that explains it and it makes sense but I didn’t think about it. It just tells me I should RTFM before using software πŸ™‚

Using git – Part I

I have been using git for a while now and I have to say I like it a lot. It’s quick, easy to use and very informative when using the webgui as well.

The one thing that is kind of odd is the fact most, if not all commands are duplicated, for example the command git-pull can also be git pull. I know it’s the same but why have two options? I know it’s not a big deal, I just hope doesn’t get out of control.

The other thing is that when you updated your files and created a tag and you push your updates to the repository it doesn’t push the tag, you have to push tag manually. The developers know about it and I believe they are working on it. Otherwise I love git.

Even though git is designed for big projects and I don’t manage a big project at all, it doesn’t stop me from using git. After Linux Linus delivered another great piece of software.

Picking a SCM

I needed a SCM and I knew there were some others out there besides CVS and SVN.

I did some searching and what it comes down to is that every SCM program has it’s supporters that will tell you that there choice is the best.
I looked at the big open source projects to see what they were using and that limited my choices a bit, I couldn’t really find a lot of projects using Mercurial, bzr.
I decided to go with git and so far it’s been a bumpy ride

I don’t have a lot of experience with SCM and that contributes to the bumpy ride, but I’m not giving up and I have solved some major issues by myself, I couldn’t clone my main repository anymore for example. I’ll keep posting about my experience with git.