git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alfred Perlstein <bright@mu.org>
To: Git Mailing List <git@vger.kernel.org>
Subject: Question on shallow clones.
Date: Fri, 20 Feb 2015 06:13:10 -0800	[thread overview]
Message-ID: <40B70861-177F-4239-A86F-49C92121ACE7@mu.org> (raw)

Hello,

Very sorry if this has been explained before, I have been doing research past few weeks in spare time and have not found a good answer yet on the safety of doing something with git.

Basically we have some repos with huge history, namely FreeBSD source and FreeBSD ports.  In order to reduce the space in $repo/.git as well as speed up clone time we were thinking of doing a shallow clone of the repo with something like --depth 5000.

I am wondering, if we such a thing, basically:

# get a shallow mirror of let's say 5000 entries
git clone --depth 5000 --mirror our-freebsd.git  smaller-freebsd.git
# move our current repo to a backup
mv our-freebsd.git our-freebsd.git.backup
# make shallow repo our primary
mv smaller-freebsd.git our-freebsd.git

Will we be able to push/pull from our "new" repo as if nothing happened?  Will hashes remain the same?

Can we in theory later do this:

# merge branches from the "github" remote and push back to "our-freebsd.git"
git clone /url/our-freebsd.git  our-freebsd.git
cd our-freebsd.git
git remote add github https://github.com/freebsd/freebsd.git
git fetch github
# get from our-freebsd
git checkout -b master origin/master
# now merge in freebsd changes
git merge --no-ff github/master
git push origin HEAD

Or will this break terribly?

Thank you very much.

-Alfred

             reply	other threads:[~2015-02-20 14:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 14:13 Alfred Perlstein [this message]
2015-02-24  9:33 ` Question on shallow clones Duy Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40B70861-177F-4239-A86F-49C92121ACE7@mu.org \
    --to=bright@mu.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).