git上传github

git上传github

  1. 创建仓库文件夹(任意位置),打开git Bash Here

    image-20240922104125509

  2. 初始化git

    image-20240922104243033

    输入

    git init
    

    生成该文件夹

    image-20240922104357825

    输入上传的信息

    git config --global user.name "用户名"
    
    git config --global user.email "邮箱"
    

    image-20240922104734831

    复制需要上传的文件

    输入

    git add .
    

    image-20240922105037520

    输入检查状态

    git status
    

    image-20240922105127707

    输入提交说明

    git commit -m "输入自己的说明"
    

    image-20240922105251777

    查看提交日志

    git log
    

    image-20240922105320347

  3. 配置github公钥

    image-20240922105427202

    image-20240922105448664

    image-20240922105502353

  4. 创建密钥

    输入,直接回车(无需密码),需要设置密码可自己设置

    ssh-keygen
    

    image-20240922105619601

    找到公钥存储位置

    image-20240922105901051

    打开公钥复制粘贴到github中

    image-20240922110046268

    保存

  5. 检查是否连接正常

    image-20240922110226433

    如出现

    ssh: connect to host github.com port 22: Connection refused
    

    可在.ssh中创建config文件可解决

    image-20240922110351110

    Host github.com
    Hostname ssh.github.com
    Port 443
    

    image-20240922110434631

    显示successflly即可

  6. 上传

    复制仓库的ssh地址

    image-20240922110642576

    输入

    git remote add origin 地址
    

    image-20240922110848706

    输入

    git push origin master
    

    image-20240922110956669

    上传成功

    image-20240922111028359

posted @   1999LIJIAN  阅读(10)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示