如何把本地项目上传github

一、在gitHub上创建新项目

【1】点击添加(+)-->New repository

【2】填写新项目的配置项

Repository name:项目名称

Description :项目的描述

Choose a license:license

【3】点击确定,项目已在github创建成功,如下图

二、本地项目上传github

【1】进入到项目文件夹,打开git branch

【2】初始化git项目

bash 复制代码
git init

运行结果:

1)

2)项目文件夹中出现.gitignore文件

【3】提交文件至git本地仓库

bash 复制代码
git add .

git commit -m "提交描述信息"

【4】切换至github上的分支,

查看github上的分支:

运行命令:

bash 复制代码
git branch -M main

输入完命令后,代码分支由master 切换至main,如下图:

【5】把远端的地址 重命名 并且添加到本地

重命名:billingSys

远端地址:https://github.com/zykHero/billingSys.git

bash 复制代码
 git remote add billingSys https://github.com/zykHero/billingSys.git

【6】push文件到github

bash 复制代码
git push -u billingSys main
相关推荐
程序视点2 小时前
GitHub Copilot代码审查大升级!路径级指令+组织级规范,开发者效率再提升!
github·github copilot
行思理7 小时前
linux 安全与防护,全方向讲解
linux·安全·github
NocoBase7 小时前
6 个最佳无代码 IT 资产管理工具推荐
低代码·开源·github
uhakadotcom8 小时前
DuckDB相比于ClickHouse有什么不同点和优势?
后端·面试·github
掘金安东尼10 小时前
Node.js 如何在 2025 年挤压 I/O 性能
前端·javascript·github
老马啸西风12 小时前
v0.29.1 敏感词性能优化之内部类+迭代器内部类
性能优化·开源·nlp·github·敏感词
杨杨杨大侠13 小时前
第5章:实现Spring Boot集成
java·github·eventbus
杨杨杨大侠13 小时前
第6章:高级特性与性能优化
java·github·eventbus
HelloGitHub14 小时前
这款开源调研系统越来越“懂事”了
前端·开源·github
ruanCat14 小时前
配置 github workflow 工作流文件,实现仓库自动更新 github page 站点
github