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

相关推荐
miofly2 小时前
GitHub 周榜趋势速报 | 2026-11-08
开源·github
miofly2 小时前
GitHub 日榜趋势速报 | 2026-11-08
开源·github
miofly17 小时前
百度开源ERNIE 5.5 Flash Base,总参数280B仅激活14B
开源·github
dong_junshuai18 小时前
每天一个开源项目#154 Nushell:结构化管道怎样跨过文本边界
github
高调的涵涵1 天前
删了1.2GB,.git仍是1.2GB
git
Jason_gao9991 天前
Github Copilot 新手极速上手指南
人工智能·github·copilot
GitHub实测笔记1 天前
hexyl 本机实测:8MiB 转储中位 102ms、od 696ms(约 6.8×);默认双面板,NO_COLOR 下要 --color=force
github
MoRay1 天前
放弃云端 Computer Use,我用 Python 手搓了一个带“物理防呆”的本地 GUI Agent 底座
python·github
用户2991422196801 天前
GitHub 热榜项目:日榜(2026-11-07)
人工智能·开源·github
程序员沉梦听雨1 天前
【Git】git-submodule子模块管理
git