- Katılım
- 24 Şubat 2018
- Mesajlar
- 24,752
Bugün github'a bir projede kullanacağımız linux çekirdek kodunu koymaya çalışırken şu hata mesajını aldım:
Bunun anlamı, github'a koymaya çalıştığım projenin fazla büyük olduğu. Linux çekirdeğinin kaynak kodunun büyüklüğüne baktım, 2.5 GByte gibi. Github belgelerine bakınca, tek tek repo büyüklüğü ile ilgili bir üst limit verilmemiş, ama tüm repo'ların toplamı 100 GByte'ı geçemez denmiş.
Bununla ilgili araştırma yapınca aşağıdaki sayfaya denk geldim:
Burada, tek seferde böyle büyük bir repo'yu gönderince github'ın hata verdiğini, ama daha küçük parçalar halinde gönderilirse sorun olmadığı belirtilmiş. Hatta bu azar azar gönderme işini yapan bir de shell script verilmiş. Bu script'i denedim ve sorunsuz olarak çekirdek kodunu github'a yüklemiş oldum.
remote: fatal: pack exceeds maximum allowed size
Bunun anlamı, github'a koymaya çalıştığım projenin fazla büyük olduğu. Linux çekirdeğinin kaynak kodunun büyüklüğüne baktım, 2.5 GByte gibi. Github belgelerine bakınca, tek tek repo büyüklüğü ile ilgili bir üst limit verilmemiş, ama tüm repo'ların toplamı 100 GByte'ı geçemez denmiş.
Bununla ilgili araştırma yapınca aşağıdaki sayfaya denk geldim:
Github remote push pack size exceeded
I am new to Git and have a fairly large project that I want to push to a remote repo (Repo B) on Github. The original project was on Github as well but from a different repo (Repo A). I have to mak...
stackoverflow.com
Burada, tek seferde böyle büyük bir repo'yu gönderince github'ın hata verdiğini, ama daha küçük parçalar halinde gönderilirse sorun olmadığı belirtilmiş. Hatta bu azar azar gönderme işini yapan bir de shell script verilmiş. Bu script'i denedim ve sorunsuz olarak çekirdek kodunu github'a yüklemiş oldum.
Kod:
#!/bin/bash
# Adjust the following variables as necessary
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=500
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
range=$REMOTE/$BRANCH..HEAD
else
# else push all the commits
range=HEAD
fi
# count the number of commits to push
n=$(git log --first-parent --format=format:x $range | wc -l)
# push each batch
for i in $(seq $n -$BATCH_SIZE 1); do
# get the hash of the commit to push
h=$(git log --first-parent --reverse --format=format:%H --skip $i -n1)
echo "Pushing $h..."
git push $REMOTE $h:refs/heads/$BRANCH
done
# push the final partial batch
git push $REMOTE HEAD:refs/heads/$BRANCH