Question on shallow clones.

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

 



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



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]