把本地的项目代码初始化到git仓库

复制代码
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
相关推荐
likuolei1 天前
Git 与 SVN 区别
git·svn
charlee441 天前
Git使用经验总结8-Git仓库历史记录清除
git·powershell·敏感信息·仓库重置·历史重写
正经教主1 天前
【Git】Git05-04:Github分支管理与协作流程
git·github
sean9081 天前
git filter-repo(优秀的 git repo 历史重写工具) 实战
git·repo·工具
hen3y1 天前
清理 Git 代码库大文件历史记录
运维·git
小Lu的开源日常1 天前
踩坑日记:为什么Git 突然 Push 不上去了
git·ssh·github
LZ7工作室1 天前
MAC编程:在MACOS安装和使用 Git 的方法
网络·git·macos·github·个人开发
T***16071 天前
Git增强现实案例
git·ar
Arva .1 天前
git常用
git
久莜1 天前
【Git】使用教程
git