<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Mike Nichols - Son Of Nun Technology : Github</title><link>http://devlicio.us/blogs/mike_nichols/archive/tags/Github/default.aspx</link><description>Tags: Github</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Using Team City With Git</title><link>http://devlicio.us/blogs/mike_nichols/archive/2010/06/12/using-team-city-with-git.aspx</link><pubDate>Sat, 12 Jun 2010 07:07:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:60258</guid><dc:creator>Michael Nichols</dc:creator><slash:comments>0</slash:comments><comments>http://devlicio.us/blogs/mike_nichols/archive/2010/06/12/using-team-city-with-git.aspx#comments</comments><description>&lt;p&gt;I love TeamCity, but I had some difficulty with setting up Team City with Git as my vcs so thought I&amp;rsquo;d log my configuration here. Documentation on the plugin is a bit sketchy and the exceptions raised when testing connections can be horrible, but the native Git plugin in Team City (v5.1+) is still under development so some features are still not completed so I expect things to be a bit rough around the edges.&lt;/p&gt;
&lt;h4&gt;Mode&lt;/h4&gt;
&lt;p&gt;I just wanted to my sources to be updated incrementally, being triggered by changes at the host. This requires having the build done on the agent (not the server):&lt;/p&gt;
&lt;p&gt;&lt;a title="teamcitygit1" href="http://www.flickr.com/photos/28939848@N08/4692100781/"&gt;&lt;img alt="teamcitygit1" src="http://farm5.static.flickr.com/4052/4692100781_4597a626b5.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Note this requires having &lt;b&gt;git&lt;/b&gt; installed on the build agent server. Team City is smart enough to find &lt;b&gt;git&lt;/b&gt; if you follow default installation of it, but I include &lt;b&gt;git&lt;/b&gt; in the PATH for consumption in the build script anyways.&lt;/p&gt;
&lt;h4&gt;Settings&lt;/h4&gt;
&lt;p&gt;Now I need to configure &lt;i&gt;what &lt;/i&gt;is getting fetched by Team City and setup &lt;b&gt;ssh&lt;/b&gt; to talk to &lt;a href="http://github.com"&gt;github&lt;/a&gt; (we host on a private repository there). All development happens on &lt;i&gt;develop&lt;/i&gt; branch so I instruct TeamCity to checkout that branch after fetching the data.&lt;/p&gt;
&lt;p&gt;Also I need to tell TeamCity about authentication:&lt;/p&gt;
&lt;p&gt;&lt;a title="teamcitygit2" href="http://www.flickr.com/photos/28939848@N08/4692759414/"&gt;&lt;img alt="teamcitygit2" src="http://farm5.static.flickr.com/4054/4692759414_4dc93edc4d.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Authentication&lt;/h4&gt;
&lt;p&gt;I believe TeamCity still only supports the &amp;lsquo;Default Private Key&amp;rsquo; option. I had seen somewhere someone using a Private Key but I wonder if they were using the older git plugin hosted at github. &lt;/p&gt;
&lt;p&gt;Anyways, the part that took me a while to understand was this note under &amp;lsquo;Authentication Method&amp;rsquo; selection:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Valid only for SSH protocol and applicable to both fetch and push urls. &lt;/p&gt;
&lt;p&gt;Uses mapping specified in the file C:\Documents and Settings\TeamCity\.ssh\config if that that file exists.&amp;nbsp; &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I run TeamCity under a user account called &amp;lsquo;TeamCity&amp;rsquo;, so this is just instructing me where the build agent will go looking when it is doing its work. It is important to note that passphrases aren&amp;rsquo;t supported yet. The &amp;lsquo;config&amp;rsquo; file threw me because I don&amp;rsquo;t know anything about ssh. I thought that was what my key file should be named (eg. &amp;lsquo;id_rsa&amp;rsquo;) . The &amp;lsquo;Known Hosts Database&amp;rsquo; checkbox is checked because I don&amp;rsquo;t want it checked&amp;hellip;confusing? I thought so too&amp;hellip;please don&amp;rsquo;t ever code an interface with a checkbox that has the label &amp;lsquo;do not check&amp;rsquo; next to it. I thought this was telling me not to check the box&amp;hellip;silly me! If you &lt;i&gt;do &lt;/i&gt;check the box Team City will in fact create the &amp;lsquo;known_hosts&amp;rsquo; database in the folder for you. &lt;/p&gt;
&lt;p&gt;The &amp;lsquo;config&amp;rsquo; file it is talking about can be simply:&lt;/p&gt;
&lt;pre&gt;Host github.com&lt;/pre&gt;
&lt;h4&gt;Fetching&lt;/h4&gt;
&lt;p&gt;Team City explicitly fetches no tags (&amp;lsquo;git fetch &amp;ndash;-no-tags&amp;rsquo;). I use tagging to marking my versions so when my tags weren&amp;rsquo;t being found in my script I wasn&amp;rsquo;t sure what was going on since I &lt;i&gt;knew &lt;/i&gt;the tags were on the remote repository. I thought for sure my n00b git skills were causing me pain. Jet brains confirmed that they are not fetching tags. This leaves two options:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Manually call &amp;lsquo;git fetch &amp;ndash;-tags&amp;rsquo; on the agent; what if I want to clean the directory and have it rebuilt? That seems error prone &lt;/li&gt;
&lt;li&gt;Call git within my build script &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I went for option 2 and that put me back in business with versioning my assemblies. I actually came across an ssh error so ended up adding this to my &lt;b&gt;config&lt;/b&gt; file mentioned earlier:&lt;/p&gt;
&lt;pre&gt;Host github.com&lt;br /&gt;StrictHostKeyChecking no&lt;/pre&gt;
&lt;p&gt;This seemed to resolve this error, but I am sure someone could tell me this is a bad idea. Works for now.&lt;/p&gt;
&lt;p&gt;As an aside, you can see the command being fired by Team City by following instructions &lt;a href="http://confluence.jetbrains.net/display/TCD4/Reporting+Issues#ReportingIssues-VersionControlDebugLogging"&gt;here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I Hope this helps!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=60258" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/mike_nichols/archive/tags/Github/default.aspx">Github</category><category domain="http://devlicio.us/blogs/mike_nichols/archive/tags/Git/default.aspx">Git</category><category domain="http://devlicio.us/blogs/mike_nichols/archive/tags/TeamCity/default.aspx">TeamCity</category></item><item><title>Removing Git Tag On Remote Repository</title><link>http://devlicio.us/blogs/mike_nichols/archive/2010/05/27/removing-git-tag-on-remote-repository.aspx</link><pubDate>Thu, 27 May 2010 22:29:26 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:59318</guid><dc:creator>Michael Nichols</dc:creator><slash:comments>0</slash:comments><comments>http://devlicio.us/blogs/mike_nichols/archive/2010/05/27/removing-git-tag-on-remote-repository.aspx#comments</comments><description>&lt;p&gt;I needed to remove a tag from a remote repository @ github.&lt;/p&gt;  &lt;p&gt;Here’s the command locally:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;git tag –d &amp;lt;mytag&amp;gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Then this:&lt;/p&gt;  &lt;pre&gt;&lt;strong&gt;git push origin :refs/tags/&amp;lt;mytag&amp;gt;&lt;/strong&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=59318" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/mike_nichols/archive/tags/Github/default.aspx">Github</category><category domain="http://devlicio.us/blogs/mike_nichols/archive/tags/Git/default.aspx">Git</category></item></channel></rss>