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
相关推荐
Aurora_th11 小时前
浙江海洋大学 资料共享 期末考试卷、课程资料等奶茶树14 小时前
【C++】13. C++11新特性【上】夏至春来-美美1 天前
git clone报错拂拉氏1 天前
【Linux】 开发工具(Makefile、git、cgdb)解析与对于操作系统的基础认识番茄不是西红柿kk2 天前
deepseek-harness跨平台桌面端二开项目(附git仓库地址+安装包)leoZ2312 天前
10-Git 仓库蒸馏术:从代码仓库到 OpenClaw 虚拟人-蒸馏工具链fpcc2 天前
工具使用—git diff命令分析说明console.log('npc')2 天前
Git 删除指定提交记录操作指南随风丶飘2 天前
[特殊字符] 告别“update“和“fix bug“——Smart Git Commit LLM 让 AI 帮你写专业的 Git 提交信息yanlaifan2 天前
git clone时候指定换行符