sourcetree 怎么吧gitee仓库拉取到本地项目中?

新建一个gitee仓库

xxx.git

复制代码
cd /你的项目路径
git init

步骤 2:添加所有文件到暂存区
git add .

步骤 3:提交到本地仓库
git commit -m "初始化提交"
步骤 4:关联远程 Gitee 仓库
https://gitee.com/你的用户名/你的仓库名.git
git remote add origin https://gitee.com/你的用户名/你的仓库名.git
步骤 5:推送本地代码到 Gitee
git push -u origin master

报错 ! rejected master -> master (fetch first)error: failed to push some refs to 'https://gitee.com/chen1142399899/react_native.git'

解决方法 1:先拉取远程仓库再推送

复制代码
git pull origin master --allow-unrelated-histories
-allow-unrelated-histories 是因为本地仓库和远程仓库没有共同历史,需要强制合并。
可能会出现冲突,解决冲突后再提交:
git add .
git commit -m "解决合并冲突"
git push -u origin master

有个gitee空仓库 本地完成的项目上传到gitee中


点击浏览 加入本地已经拉取好的项目也就是上面步骤

复制代码
相关推荐
墨天梦2 天前
D19_系统分享与文件URI
gitee·kotlin
Cc_Debugger4 天前
【从别人gitee仓库复制到自己仓库下(所有分支)】
gitee
7177775 天前
支持私有部署的 DevOps 平台推荐:Gitee 专业版与主流开源方案对比
gitee·开源·devops
7177775 天前
中小团队 CI/CD 工具选哪个:2026 年主流平台对比与 Gitee 方案解析
ci/cd·gitee
7177777 天前
国产研发管理平台推荐:技术决策者选型指南(2026)
gitee
墨天梦8 天前
D03_Compose列表与稳定身份
android·gitee·kotlin
Sun子矜8 天前
Git+Gitee 新手教程精简归纳版
git·gitee
创世虚拟世界9 天前
我做了一个 3D 虚拟世界基底,基于这个再做 3D 虚拟世界或者元宇宙,会事半功倍
javascript·人工智能·3d·gitee·虚拟现实
7177779 天前
有没有国产 Jira?2026 年主流国产替代方案对比与 Gitee 定位解析
gitee·jira
7177779 天前
软件成分分析工具哪个好:2026年主流SCA工具选型与Gitee生态实践指南
gitee