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
相关推荐
Codeking__9 小时前
Redis——基本通用命令Dontla14 小时前
Git error: fatal: detected dubious ownership in repository at xxx论迹15 小时前
【Git】-- 多人协作roamingcode16 小时前
从混沌到秩序:Git Diff 结构化报告的 Claude Code Skill 实践ss27318 小时前
idea中git更新项目:将传入更改合并到当前分支,在传入更改上变基当前分支hopsky18 小时前
好用!Git 同时开发多个分支secondyoung20 小时前
Git使用:rebase用法萧曵 丶21 小时前
CI/CD 流程import_random21 小时前
[git版本控制]git push(详解)bing_feilong1 天前
gitee pull 总是需要用户名和密码,该如何设置?