今日天气
  1. 博客/

Git Docs

·307 字·1 分钟· ·
devops git
Johny
作者
Johny
熟练的 云原生搬砖师
Table of Contents

常用进阶命令
#

  • 指定特定仓库拉取代码

    git remote add origin $giturl
    
    git pull $giturl master
    
    git branch --set-upstream-to=origin/master
    
    git status
    
    git pull 
    
  • 更改远程仓库地址

    git remote -v 
    
    git remote set-url origin $git_url
    
    git pull origin master --allow-unrelated-histories
    
    git push 
    
    git branch --set-upstream-to=origin/master
    
  • 清理本地错误的用户信息

    运行一下命令缓存输入的用户名和密码:
    
    git config --global credential.helper wincred. # macos git config --unset-all credential.manager
    
    清除掉缓存在git中的用户名和密码
    
    git credential-manager uninstall
    
    git config --unset-all credential.manager
    
  • 解决 Windows git pull 卡住不动问题

    • 原因 在 git clone 时后面仓库地址是非公开的 需要验证用户及密码 而windows 默认是已 弹窗形式

    • 解决方法:切换模式

      git config --system --unset credential.helper
      
  • 解决 git 每次 pull/push 多需要输入账号密码问题

    git config --global credential.helper store
    
  • 修改 前几次的 commit id

    git rebase -i HEAD~3
    
    git commit --amend -s #然后按`i`编辑,把`pick` 改成 `edit`,按'Esc'退出编辑,按`:wq`保存退出
    
    git rebase --continue
    
    git log
    
    git push origin dev -f # git push --force
    
  • 关闭 SSL 认证

    git config --global http.sslVerify false
    

相关文章

Git 使用问题的记录
·322 字·1 分钟·
devops linux git
Rke 集群集成 Kube-Vip 实现 Loadbalance Service 资源的使用
·6074 字·13 分钟·
devops k8s rke kube-vip Loadbalance
记录一次 Nexus3 Pypi 私服 Blob Storage 异常的修复
·1234 字·3 分钟·
devops neuxs3 fix pypi jenkins pipeline
记录一次 JupyterLab 插件打包问题的修复
·1485 字·3 分钟·
k8s devops jupyterlab jenkins
Docker-Compose 部署 Nexus3 Docker 私服,配置使用 Traefik 进行代理管理
·1228 字·3 分钟·
devops docker-compose proxy neuxs3 traefik mkcert https
在 Kubernetes 中使用 localPv 部署 Gitlab
·1040 字·3 分钟·
k8s devops ingress gitlab ci-cd localpv postgres redis