[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of git branches

From: John Wiegley
Subject: Re: Use of git branches
Date: Fri, 06 Nov 2015 11:05:36 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin)

>>>>> Juanma Barranquero <address@hidden> writes:

> I know that some old branches (though not all) are perhaps of historical
> interest. But, isn't there any way to remove them and yet keep their content
> from being pruned? Tags or something?

You can move branches into a different "ref space" on the server (this is not
tested yet, but should give the idea):

    git push origin 
    git push origin :refs/old-branches/foo

Historical branches are not fetched until you add the corresponding refspec to
your .git/config file:

    [remote "origin"]
        fetch = +refs/heads/*:refs/remotes/origin/*
        fetch = +refs/history/*:refs/remotes/origin/history/*

Now you can write:

    git log origin/history/branches/Boehm-GC


p.s. This same trick works for GitHub PRs, btw, by using:

       fetch = +refs/pull/*:refs/remotes/origin/pr/*

     Now allowing you to: git checkout -b pr/1233 origin/pr/1233

reply via email to

[Prev in Thread] Current Thread [Next in Thread]