<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>42 &#187; git</title>
	<atom:link href="http://www.42.mach7x.com/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.42.mach7x.com</link>
	<description>Thoughts and tips about programming with Ruby on Rails</description>
	<lastBuildDate>Wed, 01 Feb 2012 14:38:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using gitolite in a non standard ssh port</title>
		<link>http://www.42.mach7x.com/2011/07/12/using-gitolite-in-a-non-standard-ssh-port/</link>
		<comments>http://www.42.mach7x.com/2011/07/12/using-gitolite-in-a-non-standard-ssh-port/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 22:12:51 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[gitolite]]></category>
		<category><![CDATA[non standar ssh port]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=361</guid>
		<description><![CDATA[Problem You have moved your gitolite server or you want to be able to access your gitolite server behind a firewall and port 22 for ssh is no longer available. Solution Edit your .git/config file and replace the line with : url = git_user_name@http://server_ip:repo_name.git to the following: url = ssh://git_user_name@external_ip:non_standard_ssh_port/repo_name.git]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You have moved your gitolite server or you want to be able to access your gitolite server behind a firewall and port 22 for ssh is no longer available.</p>
<p><strong>Solution</strong><br />
Edit your .git/config file and replace the line with :</p>
<p><code>url = git_user_name@http://server_ip:repo_name.git</code></p>
<p>to the following:</p>
<p><code>url = ssh://git_user_name@external_ip:non_standard_ssh_port/repo_name.git</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2011/07/12/using-gitolite-in-a-non-standard-ssh-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.gitignore seems that is not working</title>
		<link>http://www.42.mach7x.com/2011/06/14/gitignore-seems-that-is-not-working/</link>
		<comments>http://www.42.mach7x.com/2011/06/14/gitignore-seems-that-is-not-working/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 07:57:29 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[.gitignore]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=343</guid>
		<description><![CDATA[Problem Your .gitignore file seems that is not working. You have added files there like db/schema.rb, but it keeps tracking the changes to it. Solution The cause is that the file was added to git version control before it was added in the .gitignore file. To remove the file from git tracking but without removing [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
Your .gitignore file seems that is not working. You have added files there like db/schema.rb, but it keeps tracking the changes to it.</p>
<p><strong>Solution</strong><br />
The cause is that the file was added to git version control before it was added in the .gitignore file. To remove the file from git tracking but without removing it from the filesystem use the following:<br />
<code>$ git rm --cached filename_not_to_be_tracked</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2011/06/14/gitignore-seems-that-is-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gitweb access to gitolite repository</title>
		<link>http://www.42.mach7x.com/2011/05/30/gitweb-access-to-gitolite-repository/</link>
		<comments>http://www.42.mach7x.com/2011/05/30/gitweb-access-to-gitolite-repository/#comments</comments>
		<pubDate>Mon, 30 May 2011 14:35:41 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[gitolite]]></category>
		<category><![CDATA[gitweb]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=333</guid>
		<description><![CDATA[Problem You are trying to set up gitolite access through gitweb but the gitweb page, shows &#8216;no projects avaiable&#8217; even though you have repositories available. Solution Try to follow the guide here. Some of tthe most important steps for having the right access permissions are: Add the www-data user in the gitolite group by: $ [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You are trying to set up gitolite access through gitweb but the gitweb page, shows &#8216;no projects avaiable&#8217; even though you have repositories available.</p>
<p><strong>Solution</strong><br />
Try to follow the guide <a href="http://computercamp.cdwilson.us/git-gitolite-git-daemon-gitweb-setup-on-ubunt">here</a>.<br />
Some of tthe most important steps for having the right access permissions are:</p>
<ul>
<li>Add the www-data user in the gitolite group by:<br />
<code>$ sudo usermod -a -G gitolite www-data</code></li>
<li>Add the paths to the repositories and the projects list:<br />
<code>$ sudo vi  /etc/gitweb.conf<br />
$projectroot ="/var/lib/gitolite/repositories";<br />
$projects_list="/var/lib/gitolite/projects.list";</code></li>
<li>Change the permissions in the repositories:<br />
<code>$ sudo chmod g+r /var/lib/gitolite/projects.list<br />
$ sudo chmod -R g+rx /var/lib/gitolite/repositories</code></li>
<li>Change permissions in the /var/lib/gitolite/.gitolite.rc file to allow access to the repositories:<br />
<code>$REPO_UMASK = 0027;</code></li>
<li>Finally change the git-daemon to run with the gitolite group permissions in the file /etc/sv/git-daemon/run:<br />
<code>exec chpst -ugitdaemon:gitolite</code></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2011/05/30/gitweb-access-to-gitolite-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading your Rails 3.0.3 application</title>
		<link>http://www.42.mach7x.com/2011/02/10/upgrading-your-rails-3-0-3-application/</link>
		<comments>http://www.42.mach7x.com/2011/02/10/upgrading-your-rails-3-0-3-application/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 19:45:28 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[Ruby on Rails 3.0.3]]></category>
		<category><![CDATA[Ruby on Rails 3.0.4]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=313</guid>
		<description><![CDATA[Problem After the announcements in the previous posts about the security vulnerabilities in Rails 3.0.3, you would like to update your application and deploy with the latest 3.0.4 version. Solution Change your Gemfile to replace gem 'rails', '3.0.3' with gem 'rails', '3.0.4' Run: bundle update rails Remove the old gems by using: git status and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
After the announcements in the previous posts about the security vulnerabilities in Rails 3.0.3, you would like to update your application and deploy with the latest 3.0.4 version.</p>
<p><strong>Solution</strong></p>
<ul>
<li>Change your Gemfile to replace<br />
              <code>gem 'rails', '3.0.3'</code><br />
              with<br />
              <code>gem 'rails', '3.0.4'</code></li>
<li>Run:<br />
             <code>bundle update rails</code></li>
<li>Remove the old gems by using:<br />
             <code>git status</code><br />
             and then<br />
             <code>git rm name_of_3.0.3_gem</code></li>
<li>Add the new gems to your git<br />
              <code>git add vendor/cache</code></li>
<li>Check in to your repository the new files<br />
             <code>git commit vendor/cache -m 'upgrade to rails 3.0.4'</code></li>
<li>Make sure that you also check in both your Gemfile and Gemfile.lock into your git repository<br />
             <code>git commit Gemfile Gemfile.lock -m 'update Gemfiles to use 3.0.4'</code><br />
             otherwise when you try to deploy you will see the error:<br />
             <code>You have modified your Gemfile in development but did not check the resulting snapshot (Gemfile.lock) into version control</code></li>
<li>push everything to your git repository:<br />
              <code>git push</code></li>
<li>Deploy your application with capistrano as usual:<br />
             <code>cap deploy</code></li>
<li>Your new gems for 3.0.4 should be installed on the share/bundle folder</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2011/02/10/upgrading-your-rails-3-0-3-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a new git repository in Gitorious</title>
		<link>http://www.42.mach7x.com/2010/12/30/creating-a-new-git-repository-in-gitorious/</link>
		<comments>http://www.42.mach7x.com/2010/12/30/creating-a-new-git-repository-in-gitorious/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 11:42:05 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[Gitorius]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[gitorius]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=278</guid>
		<description><![CDATA[Problem You would like to host a new git repository in Gitorius. Solution Assuming that you have created your initial ruby on rails application, and you have git installed, you can follow the steps below: Create a new account in Gitorious Copy your public ssh key (usually in ~./ssh) to your new account in Gitorius [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You would like to host a new git repository in <a href="http://gitorious.org/">Gitorius</a>.</p>
<p><strong>Solution</strong><br />
Assuming that you have created your initial ruby on rails application, and you have git installed, you can follow the steps below:</p>
<ol>
<li>Create a new account in Gitorious</li>
<li>Copy your public ssh key (usually in ~./ssh) to your new account in Gitorius</li>
<li>Create a new project in Gitorius (ie My Project)</li>
<li>Add a new repository in Gitorius (ie My Git Repository)</li>
<li>On your local development host initialise the git repository in your project&#8217;s directory: <code>git init</code></li>
<li>Add your remote hosting repository: <code>git remote add origin git@gitorious.org:my-project-name/my-git-repo.git</code></li>
<li>Add your project files: <code>git add .</code></li>
<li>Do your initial commit: <code>git commit -m "Initial commit"</code></li>
<li>Push your project to the Gitorious repository: <code>git push origin master</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/12/30/creating-a-new-git-repository-in-gitorious/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>capistrano deployment fails after dreamhost server move</title>
		<link>http://www.42.mach7x.com/2010/10/08/capistrano-deployment-fails-after-dreamhost-server-move/</link>
		<comments>http://www.42.mach7x.com/2010/10/08/capistrano-deployment-fails-after-dreamhost-server-move/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 10:27:29 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[permission denied]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=259</guid>
		<description><![CDATA[Problem You have set up your capistrano recipe for deployment to dreamhost using password less logins, but after dreamhost moves your git repository server to a different server, the deployment breaks, with &#8216;permission denied&#8217; when trying to get the git repository. Solution As the server was moved you would need to copy your ssh public [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You have set up your capistrano recipe for deployment to dreamhost using password less logins, but after dreamhost moves your git repository server to a different server, the deployment breaks, with &#8216;permission denied&#8217; when trying to get the git repository.</p>
<p><strong>Solution</strong><br />
As the server was moved you would need to copy your ssh public key from the deployment server to the new server again for the password-less logins to work again.<br />
Follow the details <a href="http://www.42.mach7x.com/2008/02/06/password-less-logins-and-aliases-with-ssh/">here</a> how to copy your public key across, login in once with your password, and after that your capistrano recipe should be working again as normal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/10/08/capistrano-deployment-fails-after-dreamhost-server-move/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>git and dreamhost : refusing to update checked out branch: refs/heads/master</title>
		<link>http://www.42.mach7x.com/2010/09/30/git-and-dreamhost-refusing-to-update-checked-out-branch-refsheadsmaster/</link>
		<comments>http://www.42.mach7x.com/2010/09/30/git-and-dreamhost-refusing-to-update-checked-out-branch-refsheadsmaster/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 11:43:18 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[server moving]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=247</guid>
		<description><![CDATA[Problem After dreamhost decided to move my account that hosted the git repository to a new server, first time I&#8217;ve tried to push some changes to the git repository I was faced with the followng error: Counting objects: 13, done. Delta compression using up to 4 threads. Compressing objects: 100% (7/7), done. Writing objects: 100% [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
After dreamhost decided to move my account that hosted the git repository to a new server, first time I&#8217;ve tried to push some changes to the git repository I was faced with the followng error:</p>
<p><code>Counting objects: 13, done.<br />
Delta compression using up to 4 threads.<br />
Compressing objects: 100% (7/7), done.<br />
Writing objects: 100% (7/7), 699 bytes, done.<br />
Total 7 (delta 6), reused 0 (delta 0)<br />
error: refusing to update checked out branch: refs/heads/master<br />
error: By default, updating the current branch in a non-bare repository<br />
error: is denied, because it will make the index and work tree inconsistent<br />
error: with what you pushed, and will require 'git reset --hard' to match<br />
error: the work tree to HEAD.<br />
error:<br />
error: You can set 'receive.denyCurrentBranch' configuration variable to<br />
error: 'ignore' or 'warn' in the remote repository to allow pushing into<br />
error: its current branch; however, this is not recommended unless you<br />
error: arranged to update its work tree to match what you pushed in some<br />
error: other way.<br />
error:<br />
error: To squelch this message and still keep the default behaviour, set<br />
error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.<br />
To ssh://dh_user@dh_domain/home/repository_path/projects/project.git</code></p>
<p><strong>Solution</strong><br />
After searching and finding out various solutions to solve the problem, none of which was specific to a server move, I&#8217;ve tried the following:</p>
<ul>
<li>Followed the steps <a href="http://www.42.mach7x.com/2010/03/12/getting-your-github-git-project-to-dreamhost/">here</a> to set up a new repository project_asm.git</li>
<li>went to local project changed the config file to add the new remote repository</li>
<li>issued <code>git push new_remote master</code></li>
<li>make a code change and then <code>git push</code></li>
</ul>
<p>And everything should work as normal again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/09/30/git-and-dreamhost-refusing-to-update-checked-out-branch-refsheadsmaster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying a Rails project in a server that hosts the git repository</title>
		<link>http://www.42.mach7x.com/2010/09/20/deploying-a-rails-project-in-a-server-that-hosts-the-git-repository/</link>
		<comments>http://www.42.mach7x.com/2010/09/20/deploying-a-rails-project-in-a-server-that-hosts-the-git-repository/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 23:07:34 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[local repository]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=228</guid>
		<description><![CDATA[Problem You want to deploy your project in a server (dreamhost), that also hosts your git repository. When you try to do that by only setting the set_repository, you get errors like &#8216;permission denied, please try again&#8217;, even though if you try to checkout the git repository on your server works. Solution Set your :repository [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You want to deploy your project in a server (dreamhost), that also hosts your git repository. When you try to do that by only setting the set_repository, you get errors like &#8216;permission denied, please try again&#8217;, even though if you try to checkout the git repository on your server works.</p>
<p><strong>Solution</strong><br />
Set your :repository as a file in your host as in:<br />
<code>set :repository, "file:///home/username/git_on_server/projects/repo_name.git"</code></p>
<p>
Then also set up your local_repository, as in:<br />
<code>set :local_repository,  "user_name@server_domain_name:/home/username/git_on_server/projects/repo_name.git"</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/09/20/deploying-a-rails-project-in-a-server-that-hosts-the-git-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting your Github git project to dreamhost</title>
		<link>http://www.42.mach7x.com/2010/03/12/getting-your-github-git-project-to-dreamhost/</link>
		<comments>http://www.42.mach7x.com/2010/03/12/getting-your-github-git-project-to-dreamhost/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 10:17:06 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[github]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=170</guid>
		<description><![CDATA[Problem You already have a project in github, but you want to move it to a different host (ie dreamhost) Solution Following the post here that describes how to setup a new git repository in dreamhost, the only difference after the initial setup : ssh username@dreamhost_domain.com mkdir -p ~/git/yourproject.git cd ~/git/yourproject.git git --bare init is [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You already have a project in github, but you want to move it to a different host (ie dreamhost)</p>
<p><strong>Solution</strong><br />
Following the post <a href="http://railstips.org/blog/archives/2008/11/23/gitn-your-shared-host-on/">here</a> that describes how to setup a new git repository in dreamhost, the only difference after the initial setup :</p>
<p><code>ssh username@dreamhost_domain.com</br><br />
mkdir -p ~/git/yourproject.git</br><br />
cd ~/git/yourproject.git</br><br />
git --bare init</code></p>
<p>is to edit your project&#8217;s .git/config file:<br />
<code>vi local_host/your_project/.git/config</code></p>
<p>and change the :<br />
<code>url = git@github.com:user_name/project_name.git</code></p>
<p>to the following:<br />
<code>ssh://dreamhost_username@dreamhost_domain/~/git/yourproject.git</code></p>
<p>Lastly you have to push for the first time to the server:<br />
<code>git push origin master</code></p>
<p>Optionally if you would like to check and/or checkout to a different pc you can use:<br />
<code>git clone ssh://dreamhost_username@dreamhost_domain/~/git/yourproject.git</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2010/03/12/getting-your-github-git-project-to-dreamhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>git and Mandriva</title>
		<link>http://www.42.mach7x.com/2008/10/02/git-and-mandriva/</link>
		<comments>http://www.42.mach7x.com/2008/10/02/git-and-mandriva/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 10:54:23 +0000</pubDate>
		<dc:creator>kosmas</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Mandriva]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[urpmi]]></category>

		<guid isPermaLink="false">http://www.42.mach7x.com/?p=51</guid>
		<description><![CDATA[Problem You want to install the git (Fast version control system) in Mandriva, but using: urpmi git installs the GNU Interactive Tools. Solution Use the following to install the version control system urpmi git-core]]></description>
			<content:encoded><![CDATA[<p><strong>Problem</strong><br />
You want to install the git (<a href="http://git.or.cz/">Fast version control system</a>) in Mandriva, but using:</p>
<pre class="code">urpmi git</pre>
<p>installs the <a href="http://www.gnu.org/software/gnuit/">GNU Interactive Tools</a>.</p>
<p><strong>Solution</strong><br />
Use the following to install the version control system</p>
<pre code="class">urpmi git-core</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.42.mach7x.com/2008/10/02/git-and-mandriva/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

