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
相关推荐
liu****17 分钟前
git工具wxr06161 小时前
git无法克隆cooldream20093 小时前
Git 拒绝推送(Push Rejected)问题全解析与解决方案实战指南wxr06164 小时前
GIT无法push装不满的克莱因瓶5 小时前
【踩坑】IDEA提交Git .gitignore忽略文件不起作用cos15 小时前
Fork 主题如何更新?基于 Ink 构建主题更新 CLI 工具OpenMiniServer16 小时前
当 AI 成为 Git 里的一个“人”Carry34518 小时前
不清楚的 .gitignore番茄灭世神1 天前
Git入门使用学习南_山无梅落1 天前
团队协作高频Git实用手册(项目实战版)