技术栈

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

斜月三2024-07-31 22:08
复制代码
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
上一篇:【剑指offer】
下一篇:【Kafka】对 kafka 消费程序客户端进行监控采集
相关推荐
wh_xia_jun
15 小时前
Git 分支合并操作备忘录
git
满天星8303577
17 小时前
【Git】原理及使用(三)(分支管理)
linux·git
像风一样的男人@
20 小时前
warning: could not find UI helper ‘git-credential-manager-ui‘
git·ui
代钦塔拉
1 天前
Git & GitHub 从入门到精通:全流程实战教程
git·github
晚风吹红霞
1 天前
Linux下的趣味编程 —— 进度条、Git版本控制与GDB调试实战
linux·运维·git
xlq22322
1 天前
7.git
git
Ws_
1 天前
Git + Gerrit 第六课:commit --amend、Patch Set 与 Change-Id
git
AIMath~
2 天前
向github中上传文件过大超过50M怎么办
网络·git·github
AIMath~
2 天前
如何将一个新的文件夹使用git 工具提交到github新仓库中
git·github
满天星8303577
2 天前
【Git】原理及使用(二) (版本回退)
linux·git
热门推荐
01GitHub 镜像站点02【AI】2026 年具身智能模型和世界模型总结03【踩坑记录 | 第一篇】微软商店无法使用时,如何手动安装 OpenAI Codex?附`.msix`文件系统错误解决方法04DeepSeek V4 + Claude Code thinking mode 400 错误修复方案05Codex 接入 DeepSeek API 完整配置文档06裂开!ChatGPT 居然开始要手机号验证,附详细解决方法07CC-Switch & Claude 基于 Linux 服务器安装使用指南08几个好用的ip纯净度检测网站09API Key 登录 Codex 也能用插件了,还支持会话删除和导出10CC-Switch 全平台下载、安装与使用全指南(Windows/macOS/Linux)