cd /path/to/your/project
# 在当前目录创建新的仓库
git init
# 添加当前目录下的所有文件到暂存区
git add .
# 添加commit message
git commit -m "Initial commit"
# 关联远程仓库
git remote add origin https://github.com/username/repository.git
# 更改默认仓库(看是否需要)
git remote set-url origin https://github.com/username/new-repository.git
# 推送到远程仓库
git push
# 查看远程仓库地址
git remote -v
把本地的项目代码初始化到git仓库
斜月三2024-07-31 22:08
相关推荐
呆萌很1 小时前
Git push 408 超时、远程断开解决办法Lesile2 小时前
Hands-on Git experienceCo_Hui3 小时前
Git 基本使用cooldream20093 小时前
AI 时代,Git 应该怎么学柒和远方5 小时前
V053: 从 Git 回退到 AI 工程治理:Vibe Coding 的 Harness 工作流与质量阀门炸膛坦客7 小时前
Git 和 GitHub:(五)一文给出常用 Git 命令,持续更新中......门前大桥下.8 小时前
从git创建新分支后推送数据同步新的分支触底反弹18 小时前
Vibe Coding 不写 Git,等于悬崖边飙车泡沫冰@19 小时前
基于Git、Jenkins、Podman、ECS的CI/CD实践zfoo-framework20 小时前
git拦截大于5M文件