首页 > 其他分享 >git 本地仓库首次推送到远程

git 本地仓库首次推送到远程

时间:2023-07-07 12:33:46浏览次数:44  
标签:search git auto fa master test 推送 远程

git init

git add .

git commit -m 'first commit'

git remote add <远程仓库地址>

$ git push origin master:master
warning: auto-detection of host provider took too long (>2000ms)
warning: see https://aka.ms/gcm/autodetect for more information.
To https://gitee.com/chaung_sun/fa_auto_search.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://gitee.com/chaung_sun/fa_auto_search.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

win@DESKTOP-MFK5B06 MINGW64 /d/jlc_auto_test/fa_search_test (master)
$ git pull --allow-unrelated-histories     # 未解决问题
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), 2.07 KiB | 124.00 KiB/s, done.
From https://gitee.com/chaung_sun/fa_auto_search
 * [new branch]      master     -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master


win@DESKTOP-MFK5B06 MINGW64 /d/jlc_auto_test/fa_search_test (master)


win@DESKTOP-MFK5B06 MINGW64 /d/jlc_auto_test/fa_search_test (master)
$ git fetch origin  # 拉取远程仓库的更新

win@DESKTOP-MFK5B06 MINGW64 /d/jlc_auto_test/fa_search_test (master)
$ git merge origin/master  # 与本地仓库合并,拉去失败,需要加--allow-unrelated-histories
fatal: refusing to merge unrelated histories



win@DESKTOP-MFK5B06 MINGW64 /d/jlc_auto_test/fa_search_test (master)
$ git merge origin/master --allow-unrelated-histories  # 成功
Merge made by the 'ort' strategy.
 README.en.md | 36 ++++++++++++++++++++++++++++++++++++
 README.md    | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+)
 create mode 100644 README.en.md
 create mode 100644 README.md

win@DESKTOP-MFK5B06 MINGW64 /d/jlc_auto_test/fa_search_test (master)
$ git push origin master:master  # 推送成功
Enumerating objects: 75, done.
Counting objects: 100% (75/75), done.
Delta compression using up to 12 threads
Compressing objects: 100% (72/72), done.
Writing objects: 100% (74/74), 18.40 MiB | 1.95 MiB/s, done.
Total 74 (delta 12), reused 0 (delta 0), pack-reused 0
remote: Powered by GITEE.COM [GNK-6.4]
To https://gitee.com/chaung_sun/fa_auto_search.git
   2b23de1..f406766  master -> master

win@DESKTOP-MFK5B06 MINGW64 /d/jlc_auto_test/fa_search_test (master)

遇到的问题:
https://blog.csdn.net/m0_63217468/article/details/126667119
https://blog.csdn.net/IT_SoftEngineer/article/details/107133313
https://blog.csdn.net/junruitian/article/details/88361895/

标签:search,git,auto,fa,master,test,推送,远程
From: https://www.cnblogs.com/czzz/p/17534636.html

相关文章

  • TortoiseGit-合并分支方法
    https://blog.csdn.net/weixin_43553694/article/details/1041184021、首先当前分支“提交”并“推送”到服务器上,比如开发分支dev合并到master上2、右键>“切换分支”到要合并的分支master 3、拉取最新master分支,然后右键选择合并,选择dev分支,勾选合......
  • git 介绍和操作
    git介绍&概述git介绍git概述git代码托管服务常用的git代码托管服务使用码云代码托管服务git常用命令git全局设置安转好git后,在文件夹空白处右击,gitbashhere,在里面输入命令。获取git仓库远程不能在仓库下嵌套仓库。这里提示的账号密码是码云的账户。工......
  • windows下安装 Git图形化统计工具 - gitstats
    gitstats是一款git历史统计工具,可以生成定量的统计数据,并以html图表的形式展示。统计文件包括文件数量、代码量、提交量、作者信息、每天活跃度、每周活跃度、每月活跃度以及提交数排名等等,信息比较丰富。安装:gitstats依赖Git、Python2以及Gnuplot。以下是最新的依赖版本。-......
  • 解决“Host key verification failed”远程连接linux服务器 could not establish conn
    在使用vscode远程连接linux服务器时,遇到了个报错:couldnotestablishconnectionto我用的服务器是腾讯云轻应用。查了半天看到阿里云文档里有类似的解决方法,最后得到解决。发现是本地缓存的问题?使用SSH远程连接Linux系统的ECS实例时,提示“Hostkeyverificationfailed”错误怎......
  • 微信模板消息推送封装方法
    /***@explain*发送消息通知*@returnarray|mixed*@remark*获取到用户的openid之后可以判断用户是否有数据,可以直接跳过获取access_token,也可以继续获取access_token*access_token每日获取次数是有限制的,access_token有时间限制,可以存储到数据库7200s.7200s后access......
  • 用hexo搭配gittee搭建个人博客:从入门到放弃
    本地环境是WSL(Debian)+vscode,仓库在gittee上hexo个人页面搭建参考:Linux云服务器下Hexo部署及使用主题地址:Hexo-Theme-freemind.bithackgittee操作参考:在Gitee搭建属于自己的博客过程比较顺利,直到在申请开通gitteepages时需要上传身份证双面照和手持身份证双面照,我放弃了。......
  • 华为超算平台git、cmake、wget、curl报错:SSLv3_client_method version OPENSSL_1_1_0
    最近在使用超算平台时报错,不管是git、cmake、wget、curl中的哪个都报错,大致错误: /usr/bin/cmake3:relocationerror:/usr/lib64/libcurl.so.4:symbolSSLv3_client_methodversionOPENSSL_1_1_0notdefinedinfilelibssl.so.1.1withlinktimereference  参考网......
  • Git 代码分支管理
    一、引言近日,IoT研发团队加入了不少新同学,对git分支的命名和管理方式有些许的模糊,分支的命名规范以及管理方式对项目的版本发布至关重要,为了解决实际开发过程中版本发布时代码管理混乱、冲突等比较头疼的问题,我们将在文中阐述如何更好的管理代码分支。二、总览从上图可以看......
  • 基于Jenkins+Gitee实现SpringBoot项目自动化部署(Docker版)
    前言:上一篇笔记:基于Jenkins+Gitee实现SpringBoot项目自动化部署(非Docker版)。本篇笔记介绍一下Docker版本的Jenkins如何实现项目自动化部署。本案例基于Linux CentOS7服务器,防火墙开放8080端口(Jenkins使用),80端口(项目使用),云服务器直接在控制台配置安全规则即可。1......
  • Git Merge Failed Merging is not possible because you have unmerged files. hint:
    ​ 这个错误提示意味着在进行gitmerge操作时,存在未解决的冲突(unmergedfiles)。Git无法自动合并这些冲突,因此您需要手动解决冲突并进行提交。要解决这个问题,您可以按照以下步骤进行操作:首先,运行gitstatus命令来查看未解决的冲突文件。您会看到类似下面的提示:Unmerged......