赞
踩
Git Large File Storage (LFS) 使用 Git 内部的文本指针替换音频样本、视频、数据集和图形等大文件,同时将文件内容存储在 GitHub.com 或 GitHub Enterprise 等远程服务器上。官网下载:https://git-lfs.github.com/
./install.sh
比如我们要上传这个strace.txt
mkdir -p /opt/git-darshan-script
cd /opt/git-darshan-script
cp /xx/storage_strace.txt .
git init
git-lfs install
参见前面安装Git-lfs。
跟踪大文件:使用以下命令告诉 Git LFS 跟踪特定文件类型的大文件:
git-lfs track "*.txt"
添加和提交大文件:使用常规的 Git 命令 git add 和 git commit 将大文件添加到 Git LFS 管理中。
git add .
git add .gitattributes
git commit -m "darshan-script"
.gitattributes 文件可以用于定义 Git 在处理文件时的行为,主要包括以下几方面:
作者身份未知*** 请告诉我您是谁。运行
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
来设置您账号的缺省身份标识。如果仅在本仓库设置身份标识,则省略 --global 参数。
git config --global user.email "fakerth1001@163.com"
git config --global user.name "fakerth"
将本地与新建仓库进行配对
git remote add origin git@github.com:fakerst/darshan-script.git
git pull --rebase origin main
Warning: Permanently added ‘github.com’ (ED25519) to the list of known hosts.git@github.com: Permission denied (publickey).
fatal: 无法读取远程仓库。
请确认您有正确的访问权限并且仓库存在。
配置公钥和私钥:
ssh-keygen -t rsa -b 4096 -C "fakerth1001@163.com"
添加私钥:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
添加公钥:
cat ~/.ssh/id_rsa.pub
将公钥复制在github上添加。
fatal: 无法找到远程引用 master,使用下面命令查看分支:
git remote show origin
分支名为main,变基为mastar。
git push origin master
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。