[Biopython-dev] Merging branches

Eric Talevich eric.talevich at gmail.com
Sun Apr 5 16:47:39 UTC 2009


2009/4/5 Bartek Wilczynski <bartek at rezolwenta.eu.org>

> Hi Tiago,
>
> >> 2009/4/4 Tiago Antão:
> >>> Is there any way to just get partial merge? In this case I only want
> >>> to merge a single sub dir (although, in general one might just want
> >>> to import a single file)
>
> Looking at specific files is not the default way things work in git.
> The idea is that if
> someone makes a single commit, it is an atomic contribution that is
> either to be
> accepted or not. You can of course create a diff file and then split
> it into specific files.
> I'll look into possible easier ways of doing it.
>
> cheers
>   Bartek
>


You can get a list of the changes that affected a single subdirectory by
giving the directory name to git log, e.g. "git log Bio/PopGen/Stats/".
Those commits don't necessarily just affect Bio/PopGen/Stats, but assuming
there aren't any single-commit code bombs, then it's probably a good idea to
take those associated modifications anyway. You can also give a range of
versions to git-log to get the commits that occurred since Gio's branch
diverged from yours -- it looks something like "git log [path] HEAD..[gio's
branch]", details are in the help page for git-rev-parse. Then you can use
that list of commits for cherry-picking, in the original order.

If it's essential to get just a specific file at a specific version, you can
find the SHA1 hash for that blob (probably easiest through github) and use
git-show with a redirect to the file in your tree, or a temporary filename.
This loses the history, though.

Cheers,
Eric




More information about the Biopython-dev mailing list