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

相关推荐
yyuuuzz21 小时前
aws亚马逊入门常见认知误区
运维·服务器·网络·云计算·github·aws
___波子 Pro Max.1 天前
Git Remote 仓库地址变更
git
逛逛GitHub1 天前
你的 Mac 就是一个 AI Agent,4B 模型本地操控电脑。
github
铁皮哥1 天前
【后端/Agent 开发】给你的项目配置一套 .claude/ 工作流:别再裸用 Claude Code 了!
java·windows·python·spring·github·maven·生活
ModestCoder_1 天前
Git 忽略所有 `.xlsx`,但保留指定 Excel 文件的方法
git·excel
阡陌..1 天前
202605新版git_2.54.0常用操作指令
大数据·git·elasticsearch
Resistance丶未来1 天前
Agency-Agents 多智能体协作系统落地指南
python·大模型·nlp·github·copilot·claude·gemini
輕華1 天前
YOLOv5 实战:从 GitHub 拉取到自定义数据集训练
yolo·github
会笑的小熊1 天前
VScode项目推送到git仓库
ide·git·vscode
zhangfeng11331 天前
宝塔服务器完全可以安装 Git,进行版本管理,而且非常简单
运维·服务器·人工智能·git·编程