从git repo中删除文件夹无法正常工作 - repo size问题

时间:2017-07-14 03:09:55

标签: git repository bitbucket

我正在尝试从我的git repo中删除一个文件夹 原因是我遇到空间问题错误remote: repository is in read only mode (over 2 GB size limit). ! [remote rejected] master -> master (pre-receive hook declined)

回购中的文件夹大约是1.32gb

我已经遵循了这些问题 - How to remove a directory from git repository?& Removing unwanted folders from git repo permanently - Repo size not changing

但仍然得到同样的错误。

有人帮忙吗?

1 个答案:

答案 0 :(得分:0)

filter-branch present in "Removing unwanted folders from git repo permanently"只能删除某些文件。其他可能仍然很重要 如评论所述,BFG有助于从回购历史记录中删除超过特定大小的所有文件。

template <typename T>

Array<T>::Array(int size)
{
    m_size = size; //set the size to be the input size
    m_data = new T[size]; //set the dynamic array to be of different size
    //cout << "size constructor" << endl;
}

template <typename T>

Array<T>::Array(const Array<T>& arr)
{
    m_size = arr.m_size;        //copy to be same size
    m_data = new T[m_size]; //copy dynamic memory of new size

    for (int i = 0; i < arr.m_size; i++) //loop through each element of new array
    {
        m_data[i] = arr.m_data[i];  //copy each new array element
    }

    cout << "copy constructor is used." << endl;
}

然后你会去git clone --mirror git://example.com/some-big-repo.git java -jar bfg.jar --strip-blobs-bigger-than 100M some-big-repo.git cd some-big-repo.git git reflog expire --expire=now --all && git gc --prune=now --aggressive 以推送所有重写的分支。