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
相关推荐
何中应19 分钟前
IDEA 中让 Git 忽略 .idea 目录小柯博客3 小时前
从零开始打造 OpenSTLinux 6.6 Yocto 系统 - STM32MP2(基于STM32CubeMX)(六)静若繁花_jingjing4 小时前
Git分支命令stu_kk5 小时前
Git常用操作指令顾默@6 小时前
关于git推送到远程仓库的一些操作___波子 Pro Max.9 小时前
Git 2.23新增命令switch使用指南℘团子এ16 小时前
git中,项目怎么更换远程仓库连接地址言之。1 天前
Git Hooks代码AI弗森1 天前
Git Bash 与 PowerShell:定位差异、使用场景与选择建议森叶1 天前
Git flow command error: ‘flow‘ is not a git command 问题解决