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分支

相关推荐
laoyeye8311 小时前
手写 vLLM 分页 KV Cache(一):先从 Continuous Batching 调度器看全局
github
徐小夕3 小时前
开源!我们用知识图谱重构了电子档案,AI 驱动全文智能关联
前端·vue.js·github
一条Go4 小时前
开源新生代雷达 · 第 13 期
github
一条Go4 小时前
Kubernetes 多集群接入:kubeconfig 只进不出
后端·架构·github
怕浪猫14 小时前
全球 3D 网络地球的实时通信节点,来看看这四种交互地球,满足你对物理互联网的所有好奇
面试·架构·github
wflynn16 小时前
GitHub 今日推荐|kiri:clone3 系统调用直达容器,2.5 毫秒启动无 runc 中间层
docker·rust·kubernetes·开源·github·containers
可乐ea17 小时前
MCP 和 CLI 差 42 倍:一次 GitHub 任务的上下文成本实测
人工智能·github·工具调用·ai智能体·openrouter·mcp协议·上下文优化
逛逛GitHub18 小时前
Claude 最新模型发布 1 周了,瞧瞧外网惊艳到震撼的玩法。
github
逛逛GitHub18 小时前
最近逛 GitHub 挑了 8 个刚开源、Star 涨得挺快的项目。
github
dong_junshuai20 小时前
每天一个开源项目#158 AG-UI:让Agent事件流接上前端状态
github