做文化墙的网站,宁波市城乡和建设网站,推广普通话的意义论文,想自己做网站推广问题1.先创建本地库#xff0c;后拉取远程仓库时上传失败的问题怎么解决#xff1f;
操作主要步骤#xff1a; step1 设置远程仓库地址: $ git remote add origin gitgitee.com:yourAccount/reponamexxx.git step2 推送到远程仓库: $ git push -u origin master后拉取远程仓库时上传失败的问题怎么解决
操作主要步骤 step1 设置远程仓库地址: $ git remote add origin gitgitee.com:yourAccount/reponamexxx.git step2 推送到远程仓库: $ git push -u origin master
报错信息
To gitgitee.com:yourAccount/reponamexxx.git! [rejected] master - master (fetch first)
error: failed to push some refs to gitee.com:yourAccount/reponamexxx.git
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., git pull ...) before pushing again.
hint: See the Note about fast-forwards in git push --help for details.解决办法 step1 拉取远程仓库使用 --allow-unrelated-histories选项本质上是合并(merge): $ git pull origin master --allow-unrelated-histories step2:在来一把不带该选项。 $ git pull origin master step3:推送 $ git push -u origin master 【注】如果是新建本地仓库没有添加任何文件只要使用如下语句就可以成功拉取。 $ git pull origin master 问题2如何在本地用命令行创建一个git仓库并推送到远程
操作主要步骤 在本地用命令行创建一个git仓库并推送到远程 1. [ git init ] 在gitStore目录下 初始化一个git仓库 2. [ git add . ] 复制一个文件到gitStore目录下然后执行[ git add . ]将“修改”从当前工作区存放到暂存区 3. [ git commit -m first commit ] 将暂存区中存放的文件提交到git仓库 4.在远端新建一个git代码库https://github.com/******* 5.git remote add origin https://github.com/******** 将本地代码库的当前分支与远程的代码库相关联 6.[ git push -u origin master ] 将本地代码库的当前分支推送到远程的代码库
问题3一大堆文件中有个文件太大的导致上传失败怎么办 问题描述 一大堆文件上传使用命令git push -u origin master后报错了截图如下 解决办法 按照提示解决
remote: error: File: a608078e6c02787b03158e5296ae238368d2fa1e 184.28 MB, exceeds 100.00 MB.
remote: Use command below to see the filename:
remote: git rev-list --objects --all | grep a608078e6c02787b03158e5296ae238368d2fa1e
remote: Please remove the file from history and try again. (https://gitee.com/help/articles/4232)1.查找大文件 2.删除缓存的文件 执行命令 git filter-branch -f --prune-empty --index-filter git rm -rf --cached --ignore-unmatch 安全/黑客大曝光(第7版).pdf --tag-name-filter cat -- --all 结果报错原因是有特殊字符。如下
$ git filter-branch -f --prune-empty --index-filter git rm -rf --cached --ignore-unmatch 黑客大曝光(第7版).pdf --tag-name-filter cat -- --all
WARNING: git-filter-branch has a glut of gotchas generating mangled historyrewrites. Hit Ctrl-C before proceeding to abort, then use analternative filtering tool such as git filter-repo(https://github.com/newren/git-filter-repo/) instead. See thefilter-branch manual page for more details; to squelch this warning,set FILTER_BRANCH_SQUELCH_WARNING1.
Proceeding with filter-branch...Rewrite de8e55eae6658a8a271604c05607a0a44a954c05 (1/4) (0 seconds passed, remaining 0 predicted) D:/Apps/DevlopSoft/Git/mingw64/libexec/git-core\git-filter-branch: eval: line 439: syntax error near unexpected token (
D:/Apps/DevlopSoft/Git/mingw64/libexec/git-core\git-filter-branch: eval: line 439: git rm -rf --cached --ignore-unmatch 黑客大曝光(第7版).pdf直觉可以用转义字符来解决执行如下命令果然可以。
$ git filter-branch -f --prune-empty --index-filter git rm -rf --cached --ignore-unmatch 黑客大曝光\(第7版\).pdf --tag-name-filter cat -- --all 3.重新推送 $ git push -u origin master --force 还是推送失败怎么办查询了下还是一样的。 $ git rev-list --objects --all | grep a608078e6c02787b03158e5296ae238368d2fa1e a608078e6c02787b03158e5296ae238368d2fa1e 安全/黑客大曝光(第7版).pdf git 如何删除本地已经提交了的超过100M的文件 要删除Git仓库中已经提交的大于100M的文件你可以按照以下步骤操作
找到提交记录中包含大文件的commit的哈希值。使用git rm --cached命令从索引中移除大文件但保留在本地磁盘上。修改最近的提交以移除大文件。强制推送到远程仓库。 以下是具体的命令
git log --oneline # 查找包含大文件的commit的哈希值
git rm --cached -r path_to_large_file # 将大文件从Git索引中移除
git commit --amend --no-edit # 修改最近的提交
git push origin your_branch_name --force # 强制推送到远程仓库 git commit --amend --no-edit # 修改最近的提交 效果 如下图推送成功。 问题4gitee单文件单库大小限制怎么办 单文件100M单库500M限制如果有需求请参考如下解决办法 参考解决文件传输难题如何绕过Gitee的100MB上传限制_gitee上传大于100m的文件-CSDN博客