[✔️]git使用遇到的问题汇总

简介: [✔️]git使用遇到的问题汇总

[✔️]git使用遇到的问题汇总


git filter-branch --force --index-filter "git rm -rf --cached --ignore-unmatch 文件路径" --prune-empty --tag-name-filter cat -- --all


替换上边的文件路径,注意分号,git会依次从所有commit中删除这个提交历史,完成之后,正常push就行了


vscode中gith关联远程分支


image.png


有时想基于remote base branch创建一个local new branch,并且希望remote自动同步新建一个remote new branch,在vscode中新建的分支会自动和remote base branch关联,预期是希望和remote new branch关联,vscode中并没有提供类似这样的操作,这时需要用到以下的git命令:


git branch -u remote/branch
git branch --set-upstream-to remote/branch


取消和远程分支关联


git branch --unset-upstream


  • 小tips 11:59:26.166: [111] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false checkout -b 3.2 ffmpeg/release/3.2^0 -- Switched to a new branch '3.2'


git action: github upload to release failed


  - name: Upload to release
    uses: xresloader/upload-to-github-release@v1
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    with:
      file: "src/libluajit.a"
      tag: false
      draft: false 


action里面上传文件时提示失败


File found to upload: /home/runner/work/luajit/luajit/src/libluajit.a
Try to get release by tag v2.1-86bd17b2 from tidys/luajit
Try to get release by tag v2.1-86bd17b2 from tidys/luajit : Not Found
Try to get draft release v2.1-86bd17b2 from tidys/luajit
Try to create release v2.1-86bd17b2 for tidys/luajit
Try to create release v2.1-86bd17b2 for tidys/luajit failed: Resource not accessible by integration
HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:5167:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:20945:13)
Error: Try to create release v2.1-86bd17b2 for tidys/luajit failed: Resource not accessible by integration
HttpError: Resource not accessible by integration
    at /home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:5167:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async run (/home/runner/work/_actions/xresloader/upload-to-github-release/v1/lib/index.js:20945:13)
Start uploading asset: /home/runner/work/luajit/luajit/src/libluajit.a(size: 672610) ...
Upload asset: libluajit.a success


解决办法


  • 方法1:在仓库的Settings/Actions/General设置读写权限


image.png


  • 方法2:在action里面配置权限: permissions: write-all
目录
相关文章
|
开发工具 git C++
『实用教程』使用Visual Studio自带的Git管理回滚代码版本
使用Visual Studio自带的Git管理回滚代码版本
1306 0
『实用教程』使用Visual Studio自带的Git管理回滚代码版本
|
24天前
|
开发工具 git
Git恢复之前版本的两种方法reset、revert(图文详解)
Git恢复之前版本的两种方法reset、revert(图文详解)
15 0
|
2月前
|
jenkins 持续交付 开发工具
gitlab远程库代码版本回滚方法
gitlab远程库代码版本回滚方法
86 1
|
2月前
|
开发工具 git
Git开发人员常用指令
Git开发人员常用指令
|
缓存 前端开发 JavaScript
CI 从Git hooks学起
前端工程化 前端工程化是前端的一个重要领域,简单的从代码规范开始,复杂的到团队脚手架搭建。在小团队中大多由开发兼任,在大团队中则可能有专门的基建团队负责。可见工程化的普及度是非常高的,只是不同团队的水平或复杂度参差不齐。 工程化对于前端开发是个必备技能。不说要学的多深多厉害,起码能 hold 住一个普通项目。我们先从 Git 的 hooks 学起,这是很多自动化的关键。
|
存储 Ubuntu Java
git各命令的原理和初级使用,顺手玩下git钩子
git各命令的原理和初级使用,顺手玩下git钩子
198 0
|
开发工具 git Windows
小工具随手记:Windows下安装Git并clone一个项目
小工具随手记:Windows下安装Git并clone一个项目
小工具随手记:Windows下安装Git并clone一个项目
|
持续交付 开发工具 git
git使用之commit规范
git使用之commit规范
249 0
|
SQL XML 数据库
Git.Framework 框架随手记--SQL配置文件的使用
  前面几篇文章讲到了如何使用框架进行简单结构的增删改查操作,由于个人能力有限在对于复杂的SQL操作面前也是无能为力,只能自己动手来写SQL语句。在Git.Framework中提供了一个公共的接口来直接操作SQL语句。
981 0