<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>gitbetter.com</title>
	
	<link>http://www.gitbetter.com</link>
	<description>Learning Git: Sharing Tips and Tricks Along the Way</description>
	<lastBuildDate>Wed, 27 Jan 2010 06:32:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/gitbetter" /><feedburner:info uri="gitbetter" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Your First Git Repositories</title>
		<link>http://feedproxy.google.com/~r/gitbetter/~3/qU6jtXB_SGI/</link>
		<comments>http://www.gitbetter.com/60/your-first-git-repositories/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 06:26:20 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://www.gitbetter.com/?p=60</guid>
		<description><![CDATA[Creating a New Git Repository Open up a terminal and cd into a directory where your project will live (or where an existing, non version-controlled project lives). Type: $ git init You&#8217;ve now got a new repo. gitignore For new projects, you&#8217;ll probably want to create a .gitignore file to tell Git which files that [...]]]></description>
			<content:encoded><![CDATA[<h2>Creating a New Git Repository</h2>
<p>Open up a terminal and <code>cd</code> into a directory where your project will live (or where an existing, non version-controlled project lives).</p>
<p>Type:<br />
<code><br />
$ git init<br />
</code><br />
You&#8217;ve now got a new repo.</p>
<h3>gitignore</h3>
<p>For new projects, you&#8217;ll probably want to create a <code>.gitignore</code> file to tell Git which files that you never want versioned. So open up a text editor, make a new file named <code>.gitignore</code>.</p>
<p>If you are building a Rails project you probably want to add things like:</p>
<pre>
log/*.log
tmp/**/*
doc/api
doc/app
</pre>
<p>If you are building a Java application using Eclipse and Maven, you might want something like:</p>
<pre>
.classpath
.project
.settings/
target/
</pre>
<p>There&#8217;s probably more that you&#8217;ll need to add to your project files, but that&#8217;s the idea.</p>
<p><em>For more on gitignore, see <a href="http://www.kernel.org/pub/software/scm/git/docs/gitignore.html">http://www.kernel.org/pub/software/scm/git/docs/gitignore.html</a></em></p>
<h2>Cloning a Git Repository</h2>
<p>The other (probably most common) way to get your hands on a repository, is to clone an existing one.</p>
<p>Something like:</p>
<pre>
$ git clone git://yourhost.com/path/to/repo-name.git
</pre>
<p>or</p>
<pre>
$ git clone https://hosthost.com/path/to/repo-name.git
</pre>
<p>or</p>
<pre>
$ git clone file:///local/path/to/repo-name.git
</pre>
<p></p>
<h2>Adding Files and Committing Changes</h2>
<p>Neither the act of creating a new repository nor cloning an existing repository adds any files to your changeset. You can edit files in your project, but the act of doing a commit will not commit any changes until you do a <code>git add</code>. </p>
<p><code>git status</code> shows you the current status of your repo. If you haven&#8217;t modified any files, you&#8217;ll see something like: </p>
<pre>
$ git status
# On branch master
nothing to commit (working directory clean)
</pre>
<p>
If you&#8217;ve modified files, but not <strong>add</strong>ed them to the changeset, you&#8217;ll see something like:</p>
<pre>
$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#	modified:   CHANGED-FILE-NAME
#
no changes added to commit (use "git add" and/or "git commit -a")
</pre>
<p></p>
<h3>Adding Files</h3>
<p>To add all files (that aren&#8217;t excluded by .gitignore):<br />
<code><br />
$ git add .<br />
</code></p>
<p>or to add a specific file</p>
<p><code><br />
$ git add file-or-folder-name<br />
</code></p>
<p><code><br />
git commit<br />
</code><br />
commit the changes, and it&#8217;s always good to add a comment.</p>
<p>From Git Community Book:</p>
<blockquote><p>A note on commit messages: Though not required, it&#8217;s a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line and then a more thorough description. Tools that turn commits into email, for example, use the first line on the Subject: line and the rest of the commit message in the body</p></blockquote>
<h3>Common Way to Add Files As You Commit</h3>
<p><code>git commit -a</code><br />
Adds all changed files to stage before committing.</p>
<p>That&#8217;s good for today &#8230;</p>
<img src="http://feeds.feedburner.com/~r/gitbetter/~4/qU6jtXB_SGI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gitbetter.com/60/your-first-git-repositories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.gitbetter.com/60/your-first-git-repositories/</feedburner:origLink></item>
		<item>
		<title>Installing Git</title>
		<link>http://feedproxy.google.com/~r/gitbetter/~3/eWq0aX4jTek/</link>
		<comments>http://www.gitbetter.com/16/installing-git/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 21:13:32 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.gitbetter.com/?p=16</guid>
		<description><![CDATA[It&#8217;s pretty easy to get Git installed. 1.) Install Based on Your Operating System Linux You may already have git installed. If not, use your package manager: $ yum install git-core or $ apt-get install git-core Mac For 10.5 or later, download and install the appropriate installer from http://code.google.com/p/git-osx-installer/ Windows Download and install the latest [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s pretty easy to get Git installed.</p>
<h2>1.) Install Based on Your Operating System</h2>
<h3>Linux</h3>
<p>You may already have <strong>git</strong> installed. If not, use your package manager:</p>
<pre>$ yum install git-core</pre>
<p>or</p>
<pre>$ apt-get install git-core</pre>
<p></p>
<h3>Mac</h3>
<p>For 10.5 or later, download and install the appropriate installer from <a href="http://code.google.com/p/git-osx-installer/">http://code.google.com/p/git-osx-installer/</a></p>
<h3>Windows</h3>
<p>Download and install the latest installer from <a href="http://code.google.com/p/msysgit/">http://code.google.com/p/msysgit/</a></p>
<h4>Note to Windows Users</h4>
<p>There are several nice GUIs for Git on Windows. It is fine to use these, but I would highly recommend learning the basics of Git using the command line. Because:</p>
<ul>
<li>You&#8217;ll better understand what&#8217;s going on which will allow you to better troubleshoot if you encounter a problem down the road when working with your GUI</li>
<li>You will more than likely find yourself in front of a Unix environment one day and you&#8217;ll already know how to deal w/ Git.</li>
</ul>
<h2>2.) Verify Git is Installed</h2>
<p>Open up a command prompt, terminal, console or whatever you want to call it and type:</p>
<pre>
$ git
</pre>
<p>If you see something like :</p>
<pre>
$ git: command not found
</pre>
<p>Something&#8217;s not right. Try installing again and take a look at your PATH environment variable.</p>
<p>But if you see something like:</p>
<pre>
usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
           [-p|--paginate|--no-pager] [--no-replace-objects]
           [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
           [--help] COMMAND [ARGS]

The most commonly used git commands are:
   add        Add file contents to the index
...
</pre>
<p>You&#8217;re good to go!</p>
<h2>3.) Configure Your User Name</h2>
<p>After you have Git installed, a terminal and set your name and email address for Git to use to sign your commits:</p>
<pre>
$ git config --global user.name "John Doe"
$ git config --global user.email "jdoe@domain.com"
</pre>
<p></p>
<h2>More Information</h2>
<p>The Git Community Book has a little more detail on installing Git for your operating system here: <a href="http://book.git-scm.com/2_installing_git.html">http://book.git-scm.com/2_installing_git.html</a></p>
<img src="http://feeds.feedburner.com/~r/gitbetter/~4/eWq0aX4jTek" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gitbetter.com/16/installing-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.gitbetter.com/16/installing-git/</feedburner:origLink></item>
		<item>
		<title>Hello World</title>
		<link>http://feedproxy.google.com/~r/gitbetter/~3/KCUvklnGUlo/</link>
		<comments>http://www.gitbetter.com/4/hello-world/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 06:04:14 +0000</pubDate>
		<dc:creator>Rob</dc:creator>
				<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://www.gitbetter.com/?p=4</guid>
		<description><![CDATA[git init I&#8217;ve been a long time Subversion (SVN) user. I have no big complaints with SVN. I used CVS and *cough* SourceSafe before switching almost exclusively to SVN. SVN has been a pleasure compared to those two version control systems! It seems like Git is here to stay, and I know that distributed version [...]]]></description>
			<content:encoded><![CDATA[<h2>git init</h2>
<p>I&#8217;ve been a long time <a href="http://en.wikipedia.org/wiki/Subversion_%28software%29">Subversion (SVN)</a> user. I have no big complaints with SVN. I used <a href="http://en.wikipedia.org/wiki/Concurrent_Versions_System">CVS</a> and *cough* <a href="http://en.wikipedia.org/wiki/Microsoft_Visual_SourceSafe">SourceSafe</a> before switching almost exclusively to SVN. SVN has been a pleasure compared to those two version control systems!</p>
<p>It seems like <a href="http://en.wikipedia.org/wiki/Git_%28software%29">Git</a> is here to stay, and I know that distributed version control is the way to go. I&#8217;ve put off using in for my projects long enough and am going to post my thoughts, trials and tribulations with Git as I learn it and switch my projects from SVN to Git.</p>
<p>Subscribe and stay tuned &#8230;</p>
<img src="http://feeds.feedburner.com/~r/gitbetter/~4/KCUvklnGUlo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.gitbetter.com/4/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.gitbetter.com/4/hello-world/</feedburner:origLink></item>
	</channel>
</rss>

