基于GitLab數(shù)據(jù)的還原研究
1.通過oss權(quán)限獲取部分不明數(shù)據(jù)
1.1全部數(shù)據(jù)及格式分析
1.1.1下載文件中的文件內(nèi)容
通過oss服務(wù)器獲取了一些包含bundle、checksum、list、lsremote后綴文件。
1.list文件內(nèi)容
2.lsremote文件內(nèi)容
3.bundle文件內(nèi)容
bundle中發(fā)現(xiàn)有g(shù)it bundle
4.checksum文件內(nèi)容
checksum文件內(nèi)容是哈希校驗值。
1.2git bundle還原
1.2.1git bundle簡介
git bundle 是一種將 Git 倉庫的對象和引用打包到一個文件中的方法。這種文件通常以 .bundle 為擴展名。要“解壓”一個 Git bundle 文件,可以通過 Git 提供的命令將其內(nèi)容導入到一個 Git 倉庫中。雖然不能直接用傳統(tǒng)的解壓工具(如 unzip)解壓 .bundle 文件,但你可以使用 Git 命令來處理它。
1.2.2git安裝
1. Windows
訪問 Git for Windows 官網(wǎng)(https://git-scm.com/download/win),下載最新的安裝程序(通常是一個 .exe 文件)。https://github.com/git-for-windows/git/releases/download/v2.46.0.windows.1/Git-2.46.0-64-bit.exe
(1)運行安裝程序
雙擊下載的 .exe 文件啟動安裝向?qū)?,按照向?qū)У闹甘具M行安裝。大多數(shù)用戶可以使用默認設(shè)置,但你可以根據(jù)需要自定義安裝選項。
(2)驗證安裝
安裝完成后,打開命令提示符(cmd)或 Git Bash。
輸入以下命令確認安裝成功:
git --version
2. macOS安裝
brew install git
3. Linux安裝
(1)Ubuntu/Debian
sudo apt update
sudo apt install git
(2)Fedora
sudo dnf install git
(3)CentOS/RHEL
sudo yum install git
1.2.3Git Bundle相關(guān)命令
1.導入 Git Bundle
(1)創(chuàng)建一個新的空 Git 倉庫(如果還沒有的話)
git init new-repo
cd new-repo
(2)將 bundle 文件的內(nèi)容導入到新的倉庫中
git fetch /path/to/your.bundle
這會將 bundle 文件中的所有對象和引用導入到當前 Git 倉庫中。
(3)檢查 bundle 文件的有效性
git bundle verify /path/to/your.bundle
(4)將 bundle 文件的內(nèi)容合并到現(xiàn)有的 Git 倉庫中
git merge FETCH_HEAD
這些步驟將使你能夠訪問和使用 Git bundle 文件中的內(nèi)容。
1.2.4實戰(zhàn)還原
1.確認bundle文件
D:\938502445ec53a1683c0cdecd5fe60142adc7648\63804a88b92fc713d05a7c53_*****-framework-full-20240309162944.bundle
2.從bundle 文件中獲取數(shù)據(jù)
git fetch D:\938502445ec53a1683c0cdecd5fe60142adc7648\63804a88b92fc713d05a7c53_l*****-framework-full-20240309162944.bundle
3.驗證數(shù)據(jù)
git bundle verify D:\938502445ec53a1683c0cdecd5fe60142adc7648\63804a88b92fc713d05a7c53_*****-framework-full-20240309162944.bundle
4.查看pack文件
5.查看詳細文件信息
git verify-pack -v .git/objects/pack/pack-a8d9691e57b4675160f9e3487eb5bc4b86716e24.pack
6.直接合并所有文件
git merge FETCH_HEAD