git提交代码github

git提交代码github

  1. git init 初始化仓库

  2. 添加用户邮箱和名字

    • git config --global user.email " github邮箱"
    • git config --global user.name " github账户名"
  3. 配置ssh密钥

    1. ssh-keygen -t rsa 获取ssh公钥
    2. cat ~/.ssh/id_rsa.pub>查看密钥
    3. github中配置密钥
  4. github中创建仓库,获取ssh 地址

  5. 添加远程仓库

    此操作是先初始化本地仓库,然后与已经创建的远程仓库进行对接。

    • 命令:git remote add <远端名称> <仓库路径>
      • 远端名称 ,默认是origin ,取决于远端服务器设置
      • 仓库路径,从远端服务器获取URL
      • 查看仓库git remote
  6. 修改端口

    1. vim ~/.ssh/config

    2. config添加

      Host github.com

      Hostname ssh.github.com

      Port 443

  7. 添加文件到github仓库

    1. git add .将所有修改的文件添加暂存区

    2. git commit 添加文件修改注释

    3. git push origin master推送到仓库master分支

相关推荐
峰向AI8 小时前
316k+ Star 史上第二热门项目,没有一行代码
github
dong_junshuai9 小时前
每天一个开源项目#86 ECC:245K星的 Agent 工程操作层
开源·github·agent
Natural10 小时前
混合检索 + RRF + Rerank 实战评测:三条路线在 47 个真实问题上的取舍
github
一点一木12 小时前
憋了7周没动静,OpenClaw 2.0带着16000个PR杀回来了
人工智能·github
一点一木15 小时前
🚀 2026 年 8 月 GitHub 十大热门项目排行榜 🔥
人工智能·github
工藤孤独17 小时前
Git Worktree 从零到多智能体实战
git
微尘寒风1 天前
【Git】的安装和使用
java·git
怕浪猫1 天前
FDE 最大的浪费不是写出有 bug 的代码,而是漂亮地解决了一个错误的问题
面试·架构·github
黄敬峰1 天前
Next.js 全栈实战:数据清洗、ORM 设计与 AI Prompt 工程最佳实践
面试·github
峰向AI1 天前
AI reads books:用 AI 逐页「啃」PDF 的知识提取器,一个脚本搞定一切
github