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 小时前
Gitlab本地服务器搭建及配置-详细教程czhc11400756632 小时前
6.11:halcon,Sqlserver;项目sql连接;git炸炸鱼.2 小时前
Git+Jenkins 基本使用:从入门到实战(知识点大全)戴国进4 小时前
git stash 用法详解木雷双雄75 小时前
Git 版本回退操作指南m0_5791466515 小时前
已被 Git 追踪的本地修改文件如何实现临时忽略糖少主18 小时前
WSL中使用Beyond Compare 3/4/5作为difftoolconsole.log('npc')20 小时前
Git版本管控:git reset \+ git push \-f 原理、实操与避坑指南恋喵大鲤鱼1 天前
git reflogMatrixOrigin1 天前
MatrixOne Git4Data 技术详解(二):从零跑通所有 Git 原语