<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Git on joh.fi</title><link>https://joh.fi/categories/git/</link><description>Recent content in Git on joh.fi</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 29 Oct 2012 18:31:00 +0000</lastBuildDate><atom:link href="https://joh.fi/categories/git/index.xml" rel="self" type="application/rss+xml"/><item><title>Git subtree merge</title><link>https://joh.fi/blog/2012-10-29-git-subtree-merge/</link><pubDate>Mon, 29 Oct 2012 18:31:00 +0000</pubDate><guid>https://joh.fi/blog/2012-10-29-git-subtree-merge/</guid><description>&lt;p&gt;Last week I took part in an intensive
&lt;a href="http://iloveponies.github.io/"&gt;Clojure-course&lt;/a&gt; which was an introduction to
functional programming using &lt;a href="http://clojure.org/"&gt;Clojure&lt;/a&gt;. The course itself
was fairly well organized and interesting but that&amp;rsquo;s not the topic of this
post.&lt;/p&gt;
&lt;p&gt;The course was built around solving small programming tasks using clojure.
Each topic had their own separate git repository on
&lt;a href="http://www.github.com"&gt;github&lt;/a&gt; which we cloned and added our solutions in.
The end result was that participants had many repositories (one for each
exercise set) and this was fine during the course. Now that I&amp;rsquo;ve successfully
passed the course I wanted to get rid of all the separate repositories and
combine them to a single git repository. I could have simply created a new
repository and copied the files into it but this way I would have lost all
commit history. I have previously used git submodules but since I won&amp;rsquo;t be
developing these assignments further I would rather not use that method. Few
minutes of googling and I found a solution for my problem,
&lt;a href="https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging"&gt;git subtree merge&lt;/a&gt;.
Subtree merge is perfect for my use case since my repositories were separate
but they shared no data with each other. In other words there would not be any
merge conflicts.&lt;/p&gt;</description></item></channel></rss>