• git 记


    1. remote: The project you were looking for could not be found or you don't have permission to view it.
    2. fatal: repository 'http://xxx.xxx.com/xxx_tools/xxx-frontend.git/' not found

    问题1:remote: The project you were looking for could not be found or you don't have permission to view it.

    凡是问个为什么:因为全局认证未生效

    1. git config --global --list //查看是否配置
    2. git config --global user.name xxx //设置系统用户名和邮箱
    3. git config --global user.email xxx
    4. git config user.name userName //设置项目用户名和邮箱
    5. git config user.email email
    6. git config user.name 查看用户名


    解决方式:1、在http://增加 “用户名@”  ,yourusername改成自己gitLab的登陆名呦

    http://yourusername@github.com/your/repository.git

    基础命令:

    1. 设置系统用户名和邮箱
    2. git config --global user.name userName
    3. git config --global user.email email
    4. cat ~/.gitconfig //查看用户
    5. git clone http://github.com/your/repository.git 与远程仓库建立连接,clone仓库文件
    6. git init //初始化本地仓库
    7. git status //查看本地仓库状态
    8. git add . //将git仓库所在的文件夹下的所有内容添加到暂存区中
    9. git add 文件名 //将git仓库所在文件夹下的某个文件添加到暂存区中
    10. git rm --cached 文件名 //将某个文件从暂存区中删除
    11. git commit -m "注释" 文件名 //提交某个文件,并附带该次提交的版本信息。
    12. git commit -m "注释" . //提交所有文件。并附带此次提交的版本信息
    13. git rm 文件名 //从本地库中删除文件
    14. git reflog //查看历史命令。包括简单的版本信息,以及版本跳转
    15. git remote -v:可查询当前本地库连接的远程库
    16. git remote add 远程库别名(最好与本地库名称一致)远程库(http或者ssH密钥):将本地库与远程库连接
    17. git remote rm 远程库别名:取消本地库和远程库之间的连接关系
    18. git push 本地库别名 本地库分支:将本地库中的某个分支推送到远程库中
    19. git pull 远程库别名 远程库分支:将远程库分支上的内容拉取到当前本地库的分支上,并直接合并
    20. 查看分支
    21. git branch -v:查看当前存在的分支
    22. 创建分支
    23. git branch 分支名:创建分支
    24. 切换分支
    25. git checkout 分支名:切换到某个分支
    26. 删除分支
    27. git branch -d 分支名:删除指定分支

  • 相关阅读:
    小白备战大厂算法笔试(四)——哈希表
    synchronized锁升级之轻量级锁
    2022年高教社杯全国大学生数学建模竞赛-A题:波浪能最大输出功率设计(附MATLAB代码)
    Apache Hadoop(一)
    【kali-信息收集】(1.6)服务的指纹识别:Nmap、Amap
    计算机网络(二):物理层
    桂林理工大学计算机考研资料汇总
    【JVM笔记】创建类和数组实例的字节码指令
    模型微调迁移学习Finetune方法大全
    vtk简单介绍、渲染流程、简单示例
  • 原文地址:https://blog.csdn.net/github_34367377/article/details/139317461