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
相关推荐
拾-光4 小时前
【Git】命令大全:从入门到高手,100 个最常用命令速查(2026 版)Snooker_1468 小时前
TRAE、VSCode上进行git管理zincsweet10 小时前
Git开发工具教程yuyuyui10 小时前
Git实战覆盖98%日常开发场景Eloudy13 小时前
git clone --mirror 同步桥cxwl3sxl13 小时前
重装系统后GIT仓库修复OYangxf13 小时前
Git速查命令OYangxf13 小时前
Git Common ErrorsMike_66613 小时前
git@gitlab-rdc.xxxxx.com: Permission denied (publickey).fatal: 无法读取远程仓库。zh路西法13 小时前
【git一键push脚本】基于Windows bat脚本的一键git提交脚本