Thursday, January 27, 2011

simple git tricks for the central repo brained

First of all, thank you Linus Torvalds for being brilliant. Also, curse you Linus Torvalds for being brilliant. But mostly thank you.

Git is awesome, powerful, and frankly simply better than svn. In order to keep it that way, I'm posting a couple simple tricks to help me remember how to get things done and keep myself from cursing such a brilliant and productive man. Yeah, I know I'm (slightly) miss-using git.

Creating a shared repository (one that more than one person can push to). I am very well aware that git is not designed to be a centralized repository system, and that it works better as a distributed system, but I'm just not willing to take the time to securely share my repository over the internet with my colleagues. Nor do I have the simple way to execute push and pull commands to random repositories in my head. Hence, I need a shared repository to simplify things for me. I don't think that's too much of a problem: I'm not developing a linux kernel, after all.

git --bare init --shared

easy, huh? Now what happens after cloning and attempting to push to the repository?

No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
error: failed to push some refs to 'blahblahblahblah'


It's a simple configuration problem - user error. I need to specify where and what to push:

git push origin master

Monday, January 17, 2011

Git on Windows (7)

For anyone who hasn't heard of git, the cvs system designed and written by Linus Torvalds, git is awesome. I mean, line by line commits? And it's so easy!

My apollogies if this article isn't fancy and error free; I'm sick & tired (I love the kids, but hate what they carry).

First thing's second: we can actually skip installing git and go straight to the gui interface, because that will give us the option to install git. I'm not terribly keen on Tortoise - it's a pain to navigate the right-click menu - so I'm testing git extensions.

Installing Git Extensions:
Install MsysGit.
Install KDiff3.
Progress through a few default options; it's nice to see that it will integrate into Visual Studio 2010! I wonder what that will look like?

After installation is complete, open up Git Extensions and add a name, etc. These are, of course, to identify you as the author of any code you commit.